site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com None of these are typically set for files or directories. You can determine if you have a directory by doing: if(S_ISDIR(stat_buf.st_mode)) Shantonu On Sep 12, 2004, at 1:27 AM, Hugh Hoover wrote: Any suggestions? _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... You are confused about what this field contains. returning 0 is normal for that field. See chflags(2) for typical contents. From <sys/stat.h>: /* * Definitions of flags stored in file flags word. * * Super-user and owner changeable flags. */ #define UF_SETTABLE 0x0000ffff /* mask of owner changeable flags */ #define UF_NODUMP 0x00000001 /* do not dump file */ #define UF_IMMUTABLE 0x00000002 /* file may not be changed */ #define UF_APPEND 0x00000004 /* writes to file may only append */ #define UF_OPAQUE 0x00000008 /* directory is opaque wrt. union */ /* * Super-user changeable flags. */ #define SF_SETTABLE 0xffff0000 /* mask of superuser changeable flags */ #define SF_ARCHIVED 0x00010000 /* file is archived */ #define SF_IMMUTABLE 0x00020000 /* file may not be changed */ #define SF_APPEND 0x00040000 /* writes to file may only append */ This is not Darwin specific... You may want to check out a unix program text on this matter for further information. Hi - I'm attempting to use stat on 10.3.5 and getting back strange results... The first items in the result stat_buf struct seems more or less correct, dev, inode, uid, gid, times, size, etc. The nlinks field seems suspicious, but the killer is the st_flags field - it's ALWAYS 0 - even for directories (which is why I'm doing the stat - to find out if I have a directory or not). I've checked the sys/stat.h header and everything appears to be in order there. I'm pretty sure I've got the right set of headers (for 10.3). TIA This email sent to site_archiver@lists.apple.com
participants (1)
-
Shantonu Sen