Index: io/fileio/current/ChangeLog =================================================================== RCS file: /cvs/ecos/ecos/packages/io/fileio/current/ChangeLog,v retrieving revision 1.48 diff -u -r1.48 ChangeLog --- io/fileio/current/ChangeLog 14 Oct 2004 07:34:29 -0000 1.48 +++ io/fileio/current/ChangeLog 22 Oct 2004 14:04:09 -0000 @@ -1,3 +1,13 @@ +2004-10-13 David Brennan + + * include/fileio.h: + * src/file.cxx: Added support for cyg_fs_fssync, + cyg_fs_get_attrib, and cyg_fs_set_attrib + +2004-10-13 David Brennan + + * src/file.cxx: Added a check data ptr in LOCK_FS + 2004-10-06 David Brennan * tests/pselect.c: Added check for POSIX signals while building Index: io/fileio/current/include/fileio.h =================================================================== RCS file: /cvs/ecos/ecos/packages/io/fileio/current/include/fileio.h,v retrieving revision 1.10 diff -u -r1.10 fileio.h --- io/fileio/current/include/fileio.h 1 Dec 2003 14:30:33 -0000 1.10 +++ io/fileio/current/include/fileio.h 22 Oct 2004 14:04:09 -0000 @@ -154,6 +154,8 @@ #define FS_INFO_CONF 1 /* pathconf() */ #define FS_INFO_ACCESS 2 /* access() */ #define FS_INFO_GETCWD 3 /* getcwd() */ +#define FS_INFO_SYNC 4 /* cyg_fs_fssync() */ +#define FS_INFO_ATTRIB 5 /* cyg_fs_(get|set)_attrib() */ //----------------------------------------------------------------------------- // Types for link() @@ -170,6 +172,8 @@ size_t size; /* size of buffer */ }; +typedef cyg_uint32 cyg_fs_attrib_t; + //----------------------------------------------------------------------------- // Macro to define an initialized fstab entry @@ -330,7 +334,7 @@ #define CYG_FILE_TYPE_DEVICE 3 /* device */ //----------------------------------------------------------------------------- -// Keys for getinf() and setinfo() +// Keys for getinfo() and setinfo() #define FILE_INFO_CONF 1 /* fpathconf() */ @@ -422,6 +426,21 @@ __externC time_t cyg_timestamp(void); //============================================================================= +// Miscellaneous functions. + +// Provide a function to synchronize an individual file system. (ie write +// file and directory information to disk) +__externC int cyg_fs_fssync(const char *path); + +// Functions to set and get attributes of a file, eg FAT attributes +// like hidden and system. +__externC int cyg_fs_set_attrib( const char *fname, + const cyg_fs_attrib_t new_attrib ); +__externC int cyg_fs_get_attrib( const char *fname, + cyg_fs_attrib_t * const file_attrib ); + + +//============================================================================= // Default functions. // Cast to the appropriate type, these functions can be put into any of // the operation table slots to provide the defined error code. Index: io/fileio/current/src/file.cxx =================================================================== RCS file: /cvs/ecos/ecos/packages/io/fileio/current/src/file.cxx,v retrieving revision 1.10 diff -u -r1.10 file.cxx --- io/fileio/current/src/file.cxx 15 Mar 2004 15:41:36 -0000 1.10 +++ io/fileio/current/src/file.cxx 22 Oct 2004 14:04:10 -0000 @@ -71,6 +71,7 @@ #define LOCK_FS( _mte_ ) { \ CYG_ASSERT(_mte_ != NULL, "Bad mount table entry"); \ + CYG_ASSERT(_mte_->fs != NULL, "Bad mount filesystem entry"); \ cyg_fs_lock( _mte_, (_mte_)->fs->syncmode); \ } @@ -524,6 +525,99 @@ } //========================================================================== +// Sync filesystem without unmounting + +__externC int cyg_fs_fssync( const char *path ) +{ + FILEIO_ENTRY(); + + int ret = 0; + cyg_mtab_entry *mte = cyg_cdir_mtab_entry; + cyg_dir dir = cyg_cdir_dir; + const char *name = path; + + ret = cyg_mtab_lookup( &dir, &name, &mte ); + + if( 0 != ret ) + FILEIO_RETURN(ENOENT); + + LOCK_FS( mte ); + + ret = mte->fs->setinfo( mte, dir, name, FS_INFO_SYNC, NULL, 0 ); + + UNLOCK_FS( mte ); + + if( 0 != ret ) + FILEIO_RETURN(ret); + + FILEIO_RETURN_VALUE(ENOERR); +} + +//========================================================================== +// Set file attributes + +__externC int cyg_fs_set_attrib( const char *fname, + const cyg_fs_attrib_t new_attrib ) +{ + FILEIO_ENTRY(); + + int ret = 0; + cyg_mtab_entry *mte = cyg_cdir_mtab_entry; + cyg_dir dir = cyg_cdir_dir; + const char *name = fname; + + ret = cyg_mtab_lookup( &dir, &name, &mte ); + + if( 0 != ret ) + FILEIO_RETURN(ENOENT); + + LOCK_FS( mte ); + + ret = mte->fs->setinfo( mte, dir, name, + FS_INFO_ATTRIB, + (char *)&new_attrib, sizeof(new_attrib) ); + + UNLOCK_FS( mte ); + + if( 0 != ret ) + FILEIO_RETURN(ret); + + FILEIO_RETURN(ENOERR); +} + +//========================================================================== +// Get file attributes + +__externC int cyg_fs_get_attrib( const char *fname, + cyg_fs_attrib_t * const file_attrib ) +{ + FILEIO_ENTRY(); + + int ret = 0; + cyg_mtab_entry *mte = cyg_cdir_mtab_entry; + cyg_dir dir = cyg_cdir_dir; + const char *name = fname; + + ret = cyg_mtab_lookup( &dir, &name, &mte ); + + if( 0 != ret ) + FILEIO_RETURN(ENOENT); + + LOCK_FS( mte ); + + ret = mte->fs->getinfo( mte, dir, name, + FS_INFO_ATTRIB, + (char *)file_attrib, sizeof(*file_attrib) ); + + UNLOCK_FS( mte ); + + if( 0 != ret ) + FILEIO_RETURN(ret); + + FILEIO_RETURN(ENOERR); +} + +//========================================================================== // Access() function. // This simply piggybacks onto stat(). Index: fs/fat/current/ChangeLog =================================================================== RCS file: /cvs/ecos/ecos/packages/fs/fat/current/ChangeLog,v retrieving revision 1.3 diff -u -r1.3 ChangeLog --- fs/fat/current/ChangeLog 13 Oct 2004 21:11:37 -0000 1.3 +++ fs/fat/current/ChangeLog 22 Oct 2004 14:04:11 -0000 @@ -1,3 +1,17 @@ +2004-10-17 David Brennan + + * src/fatfs.c: + * src/fatfs_supp.c: + * include/fatfs.h (NEW): + * tests/fileio1.c: + * cdl/fatfs.cdl: Added configurable support for FAT filesystem + attributes. + +2004-10-13 David Brennan + + * src/fatfs.c: Added code to setinfo to allow performing a + file-system sync + 2004-10-06 David Brennan * tests/fileio1.c: Added include of to fix compiler Index: fs/fat/current/cdl/fatfs.cdl =================================================================== RCS file: /cvs/ecos/ecos/packages/fs/fat/current/cdl/fatfs.cdl,v retrieving revision 1.2 diff -u -r1.2 fatfs.cdl --- fs/fat/current/cdl/fatfs.cdl 5 Oct 2004 07:45:59 -0000 1.2 +++ fs/fat/current/cdl/fatfs.cdl 22 Oct 2004 14:04:11 -0000 @@ -48,7 +48,7 @@ cdl_package CYGPKG_FS_FAT { display "FAT filesystem" - include_dir cyg/fatfs + include_dir cyg/fs requires CYGPKG_IO_FILEIO @@ -57,7 +57,6 @@ requires CYGINT_ISO_ERRNO_CODES requires CYGPKG_MEMALLOC requires CYGPKG_BLOCK_LIB -# requires CYGFUN_LIBC_STRING_BSD_FUNCS implements CYGINT_IO_FILEIO_FS @@ -105,6 +104,14 @@ sanity checks in node cache code." } + cdl_option CYGCFG_FS_FAT_USE_ATTRIBUTES { + display "Support for FAT FS file attributes" + flavor bool + default_value 0 + description "This option controls if the FAT filesystem supports + or honors the FAT filesystem file attributes." + } + # -------------------------------------------------------------------- cdl_option CYGPKG_FS_FAT_TESTS { Index: fs/fat/current/src/fatfs.c =================================================================== RCS file: /cvs/ecos/ecos/packages/fs/fat/current/src/fatfs.c,v retrieving revision 1.2 diff -u -r1.2 fatfs.c --- fs/fat/current/src/fatfs.c 5 Oct 2004 07:45:59 -0000 1.2 +++ fs/fat/current/src/fatfs.c 22 Oct 2004 14:04:13 -0000 @@ -73,6 +73,7 @@ #include #include #include +#include #include "fatfs.h" @@ -629,6 +630,13 @@ if (S_ISDIR(node->dentry.mode)) return EISDIR; +#ifdef CYGCFG_FS_FAT_USE_ATTRIBUTES + // if the file is read only and is opened for writing + // fail with permission error + if (S_FATFS_ISRDONLY(node->dentry.attrib) && (mode & O_WRONLY)) + return EACCES; +#endif // CYGCFG_FS_FAT_USE_ATTRIBUTES + // Allocate file object private data and // make a reference to this file node @@ -678,6 +686,12 @@ if (ds.node->refcnt > 0) return EBUSY; +#ifdef CYGCFG_FS_FAT_USE_ATTRIBUTES + // if the file is read only fail with permission error + if (S_FATFS_ISRDONLY(ds.node->dentry.attrib)) + return EPERM; +#endif // CYGCFG_FS_FAT_USE_ATTRIBUTES + err = fatfs_delete_file(disk, &ds.node->dentry); if (err == ENOERR) fatfs_node_free(disk, ds.node); @@ -789,6 +803,12 @@ if (err != ENOERR) return err; +#ifdef CYGCFG_FS_FAT_USE_ATTRIBUTES + // if the file is read only fail with permission error + if (S_FATFS_ISRDONLY(ds1.node->dentry.attrib)) + return EPERM; +#endif // CYGCFG_FS_FAT_USE_ATTRIBUTES + // Protect the found nodes from being reused // by the search for the ds2 dir/node pair fatfs_node_ref(disk, ds1.dir); @@ -983,6 +1003,10 @@ // Fill in the status buf->st_mode = ds.node->dentry.mode; +#ifdef CYGCFG_FS_FAT_USE_ATTRIBUTES + if (!S_FATFS_ISRDONLY(ds.node->dentry.attrib)) + buf->st_mode |= (S_IWUSR | S_IWGRP | S_IWOTH); +#endif // CYGCFG_FS_FAT_USE_ATTRIBUTES buf->st_ino = (ino_t) ds.node->dentry.cluster; buf->st_dev = 0; buf->st_nlink = 1; @@ -996,9 +1020,75 @@ return ENOERR; } +#ifdef CYGCFG_FS_FAT_USE_ATTRIBUTES +// ------------------------------------------------------------------------- +// fatfs_set_attrib() +// Set FAT file system attributes for specified file + +static int +fatfs_set_attrib(cyg_mtab_entry *mte, + cyg_dir dir, + const char *name, + const cyg_fs_attrib_t new_attrib) +{ + fatfs_disk_t *disk = (fatfs_disk_t *) mte->data; + fatfs_dirsearch_t ds; + int err; + + CYG_TRACE4(TFS, "chmod mte=%p dir=%p name='%s' buf=%x", + mte, dir, name, new_attrib); + + // Verify new_mode is valid + if ((new_attrib & S_FATFS_ATTRIB) != new_attrib) + return EINVAL; + + init_dirsearch(&ds, disk, (fatfs_node_t *) dir, name); + + err = fatfs_find(&ds); + if (err != ENOERR) + return err; + + // Change the "changeable" mode bits for the file. + ds.node->dentry.attrib = + (ds.node->dentry.attrib & (~S_FATFS_ATTRIB)) | new_attrib; + + return fatfs_write_dir_entry(disk,&ds.node->dentry); +} + +// ------------------------------------------------------------------------- +// fatfs_get_attrib() +// Set FAT file system attributes for specified file + +static int +fatfs_get_attrib(cyg_mtab_entry *mte, + cyg_dir dir, + const char *name, + cyg_fs_attrib_t * const file_attrib) +{ + fatfs_disk_t *disk = (fatfs_disk_t *) mte->data; + fatfs_dirsearch_t ds; + int err; + + CYG_TRACE4(TFS, "chmod mte=%p dir=%p name='%s' buf=%x", + mte, dir, name, new_attrib); + + init_dirsearch(&ds, disk, (fatfs_node_t *) dir, name); + + err = fatfs_find(&ds); + if (err != ENOERR) + return err; + + // Get the attribute field + CYG_CHECK_DATA_PTR(file_attrib,"Invalid destination attribute pointer"); + *file_attrib = ds.node->dentry.attrib; + + return ENOERR; +} +#endif // CYGCFG_FS_FAT_USE_ATTRIBUTES + // ------------------------------------------------------------------------- // fatfs_getinfo() -// Getinfo. Nothing to support here at present. +// Getinfo. Support for attrib static int fatfs_getinfo(cyg_mtab_entry *mte, @@ -1008,14 +1098,27 @@ void *buf, int len) { + int err = EINVAL; + CYG_TRACE6(TFS, "getinfo mte=%p dir=%p name='%s' key=%d buf=%p len=%d", mte, dir, name, key, buf, len); - return EINVAL; + switch( key ) + { +#ifdef CYGCFG_FS_FAT_USE_ATTRIBUTES + case FS_INFO_ATTRIB: + err = fatfs_get_attrib(mte, dir, name, (cyg_fs_attrib_t*)buf); + break; +#endif // CYGCFG_FS_FAT_USE_ATTRIBUTES + default: + err = EINVAL; + break; + } + return err; } // ------------------------------------------------------------------------- // fatfs_setinfo() -// Setinfo. Nothing to support here at present. +// Setinfo. Support for fssync and attrib static int fatfs_setinfo(cyg_mtab_entry *mte, @@ -1025,9 +1128,26 @@ void *buf, int len) { - CYG_TRACE6(TFS, "getinfo mte=%p dir=%p name='%s' key=%d buf=%p len=%d", + int err = EINVAL; + + CYG_TRACE6(TFS, "setinfo mte=%p dir=%p name='%s' key=%d buf=%p len=%d", mte, dir, name, key, buf, len); - return EINVAL; + + switch( key ) + { + case FS_INFO_SYNC: + err = cyg_blib_sync(&(((fatfs_disk_t *) mte->data)->blib)); + break; +#ifdef CYGCFG_FS_FAT_USE_ATTRIBUTES + case FS_INFO_ATTRIB: + err = fatfs_set_attrib(mte, dir, name, *(cyg_fs_attrib_t *)buf); + break; +#endif // CYGCFG_FS_FAT_USE_ATTRIBUTES + default: + err = EINVAL; + break; + } + return err; } //========================================================================== Index: fs/fat/current/src/fatfs.h =================================================================== RCS file: /cvs/ecos/ecos/packages/fs/fat/current/src/fatfs.h,v retrieving revision 1.2 diff -u -r1.2 fatfs.h --- fs/fat/current/src/fatfs.h 5 Oct 2004 07:45:59 -0000 1.2 +++ fs/fat/current/src/fatfs.h 22 Oct 2004 14:04:13 -0000 @@ -124,6 +124,9 @@ cyg_uint32 cluster; // First cluster number cyg_uint32 parent_cluster; // First cluster of parent dentry fatfs_data_pos_t disk_pos; // Position of dir entry on disk +#ifdef CYGCFG_FS_FAT_USE_ATTRIBUTES + cyg_fs_attrib_t attrib; // Attribute bits for DOS compatability +#endif //CYGCFG_FS_FAT_USE_ATTRIBUTES } fatfs_dir_entry_t; typedef struct fatfs_node_s Index: fs/fat/current/src/fatfs_supp.c =================================================================== RCS file: /cvs/ecos/ecos/packages/fs/fat/current/src/fatfs_supp.c,v retrieving revision 1.2 diff -u -r1.2 fatfs_supp.c --- fs/fat/current/src/fatfs_supp.c 5 Oct 2004 07:45:59 -0000 1.2 +++ fs/fat/current/src/fatfs_supp.c 22 Oct 2004 14:04:16 -0000 @@ -53,6 +53,7 @@ #include #include #include +#include #include #include @@ -64,24 +65,14 @@ // FAT defines & macros // ------------------------------------------------------------------------- -// FAT dir entry attributes - -#define DENTRY_ATTR_RDONLY 0x01 // Read only -#define DENTRY_ATTR_HIDDEN 0x02 // Hidden -#define DENTRY_ATTR_SYSTEM 0x04 // System -#define DENTRY_ATTR_VOLUME 0x08 // Volume label -#define DENTRY_ATTR_DIR 0x10 // Subdirectory -#define DENTRY_ATTR_ARCHIVE 0x20 // Needs archiving - -// ------------------------------------------------------------------------- // FAT dir entry attributes macros -#define DENTRY_IS_RDONLY(_dentry_) ((_dentry_)->attr & DENTRY_ATTR_RDONLY) -#define DENTRY_IS_HIDDEN(_dentry_) ((_dentry_)->attr & DENTRY_ATTR_HIDDEN) -#define DENTRY_IS_SYSTEM(_dentry_) ((_dentry_)->attr & DENTRY_ATTR_SYSTEM) -#define DENTRY_IS_VOLUME(_dentry_) ((_dentry_)->attr & DENTRY_ATTR_VOLUME) -#define DENTRY_IS_DIR(_dentry_) ((_dentry_)->attr & DENTRY_ATTR_DIR) -#define DENTRY_IS_ARCHIVE(_dentry_) ((_dentry_)->attr & DENTRY_ATTR_ARCHIVE) +#define DENTRY_IS_RDONLY(_dentry_) (S_FATFS_ISRDONLY((_dentry_)->attr)) +#define DENTRY_IS_HIDDEN(_dentry_) (S_FATFS_ISHIDDEN((_dentry_)->attr)) +#define DENTRY_IS_SYSTEM(_dentry_) (S_FATFS_ISSYSTEM((_dentry_)->attr)) +#define DENTRY_IS_VOLUME(_dentry_) (S_FATFS_ISVOLUME((_dentry_)->attr)) +#define DENTRY_IS_DIR(_dentry_) (S_FATFS_ISDIR((_dentry_)->attr)) +#define DENTRY_IS_ARCHIVE(_dentry_) (S_FATFS_ISARCHIVE((_dentry_)->attr)) #define DENTRY_IS_DELETED(_dentry_) \ (0xE5 == (cyg_uint8)((_dentry_)->name[0])) @@ -1624,6 +1615,10 @@ else dentry->mode = __stat_mode_REG; +#ifdef CYGCFG_FS_FAT_USE_ATTRIBUTES + dentry->attrib = raw_dentry->attr; +#endif // CYGCFG_FS_FAT_USE_ATTRIBUTES + date_dos2unix(raw_dentry->crt_time, raw_dentry->crt_date, &dentry->ctime); date_dos2unix(0, raw_dentry->acc_date, &dentry->atime); date_dos2unix(raw_dentry->wrt_time, raw_dentry->wrt_date, &dentry->mtime); @@ -1644,9 +1639,13 @@ set_raw_dentry_filename(raw_dentry, dentry->filename, 0); if (__stat_mode_DIR == dentry->mode) - raw_dentry->attr = DENTRY_ATTR_DIR; + raw_dentry->attr = S_FATFS_DIR; else - raw_dentry->attr = DENTRY_ATTR_ARCHIVE; + raw_dentry->attr = S_FATFS_ARCHIVE; +#ifdef CYGCFG_FS_FAT_USE_ATTRIBUTES + raw_dentry->attr = dentry->attrib; +#endif // CYGCFG_FS_FAT_USE_ATTRIBUTES + date_unix2dos(dentry->ctime, &raw_dentry->crt_time, &raw_dentry->crt_date); date_unix2dos(dentry->atime, NULL, &raw_dentry->acc_date); @@ -1808,6 +1807,14 @@ dentry->filename[namelen] = '\0'; dentry->mode = mode; + +#ifdef CYGCFG_FS_FAT_USE_ATTRIBUTES + if (S_ISDIR(dentry->mode)) + dentry->attrib = S_FATFS_DIR; + else + dentry->attrib = S_FATFS_ARCHIVE; +#endif // CYGCFG_FS_FAT_USE_ATTRIBUTES + dentry->ctime = dentry->atime = dentry->mtime = cyg_timestamp(); @@ -1939,6 +1946,9 @@ CYG_CHECK_DATA_PTRC(dentry); dentry->mode = __stat_mode_DIR; +#ifdef CYGCFG_FS_FAT_USE_ATTRIBUTES + dentry->attrib = S_FATFS_DIR; +#endif // CYGCFG_FS_FAT_USE_ATTRIBUTES dentry->size = disk->fat_root_dir_size; dentry->ctime = 0; dentry->atime = 0; @@ -2389,7 +2399,7 @@ // If we moved a directory, we also have to correct the '..' entry - if (__stat_mode_DIR == target->mode) + if ( S_ISDIR(target->mode) ) { fat_raw_dir_entry_t raw_cdentry; fatfs_data_pos_t pos; Index: fs/fat/current/tests/fileio1.c =================================================================== RCS file: /cvs/ecos/ecos/packages/fs/fat/current/tests/fileio1.c,v retrieving revision 1.2 diff -u -r1.2 fileio1.c --- fs/fat/current/tests/fileio1.c 13 Oct 2004 21:11:38 -0000 1.2 +++ fs/fat/current/tests/fileio1.c 22 Oct 2004 14:04:17 -0000 @@ -60,6 +60,7 @@ #include #include #include +#include #include // base kernel types #include // tracing macros @@ -77,6 +78,7 @@ #include #include // HAL polled output +#include @@ -288,6 +290,26 @@ if( err < 0 ) SHOW_RESULT( close, err ); } +#ifdef CYGCFG_FS_FAT_USE_ATTRIBUTES +//========================================================================== + +static void checkattrib(const char *name, + const cyg_fs_attrib_t test_attrib ) +{ + int err; + cyg_fs_attrib_t file_attrib; + + diag_printf(": check attrib %s\n",name); + + err = cyg_fs_get_attrib(name, &file_attrib); + if( err != 0 ) SHOW_RESULT( stat, err ); + + if ( (file_attrib & S_FATFS_ATTRIB) != test_attrib ) + diag_printf(": attrib %s incorrect\n\tExpected %x Was %x\n", + name,test_attrib,(file_attrib & S_FATFS_ATTRIB)); +} +#endif // CYGCFG_FS_FAT_USE_ATTRIBUTES + //========================================================================== static void copyfile( char *name2, char *name1 ) @@ -643,6 +665,70 @@ if( err < 0 ) SHOW_RESULT( umount, err ); #endif +#ifdef CYGCFG_FS_FAT_USE_ATTRIBUTES + // Create file + diag_printf(": create /foo\n"); + createfile( "/foo", 20257 ); + + // Verify it is created with archive bit set + checkattrib( "/foo", S_FATFS_ARCHIVE ); + + // Make it System + diag_printf(": attrib -A+S /foo\n"); + err = cyg_fs_set_attrib( "/foo", S_FATFS_SYSTEM ); + if( err < 0 ) SHOW_RESULT( chmod system , err ); + + // Verify it is now System + checkattrib( "/foo", S_FATFS_SYSTEM ); + + // Make it Hidden + diag_printf(": attrib -S+H /foo\n"); + err = cyg_fs_set_attrib( "/foo", S_FATFS_HIDDEN ); + if( err < 0 ) SHOW_RESULT( chmod system , err ); + + // Verify it is now Hidden + checkattrib( "/foo", S_FATFS_HIDDEN ); + + // Make it Read-only + diag_printf(": attrib -H+R /foo\n"); + err = cyg_fs_set_attrib( "/foo", S_FATFS_RDONLY ); + if( err < 0 ) SHOW_RESULT( chmod system , err ); + + // Verify it is now Read-only + checkattrib( "/foo", S_FATFS_RDONLY ); + + // Verify we cannot unlink a read-only file + diag_printf(": unlink /foo\n"); + err = unlink( "/foo" ); + if( err != -EPERM ) SHOW_RESULT( unlink, err ); + + // Verify we cannot rename a read-only file + diag_printf(": rename /foo bundy\n"); + err = rename( "/foo", "bundy" ); + if( err != -EPERM ) SHOW_RESULT( rename, err ); + + // Verify we cannot open read-only file for writing + int fd; + diag_printf(": create file /foo\n"); + fd = open( "/foo", O_WRONLY ); + if( err != -EPERM ) SHOW_RESULT( rename, err ); + if( err > 0 ) close(fd); + + // Make it Normal + diag_printf(": attrib -H /foo\n"); + err = cyg_fs_set_attrib( "/foo", 0 ); + if( err < 0 ) SHOW_RESULT( chmod none , err ); + + // Verify it is now nothing + checkattrib( "/foo", 0 ); + + // Now delete our test file + diag_printf(": unlink /foo\n"); + err = unlink( "/foo" ); + if( err < 0 ) SHOW_RESULT( unlink, err ); + +#endif // CYGCFG_FS_FAT_USE_ATTRIBUTES + maxfile("file.max"); listdir( "/", true, -1, NULL ); @@ -650,7 +736,6 @@ diag_printf(": unlink file.max\n"); err = unlink( "file.max" ); if( err < 0 ) SHOW_RESULT( unlink, err ); - diag_printf(": umount /\n"); err = umount( "/" ); if( err < 0 ) SHOW_RESULT( umount, err );