Re: Value of st_flags returned by stat() when no flags are set
Re: Value of st_flags returned by stat() when no flags are set
- Subject: Re: Value of st_flags returned by stat() when no flags are set
- From: Mo McRoberts <email@hidden>
- Date: Fri, 22 Jan 2010 14:37:41 +0000
On Fri, Jan 22, 2010 at 14:32, rohan a <email@hidden> wrote:
> Hello All,
> I am using the stat() API to fetch the BSD flags (chflags) set on a file.
> There are several flag types like arch, hidden, nodump opaque etc. All of
> these have certain values associated with them defined in
> </usr/include/sys/stat.h>
> What value would be stored in st_flags when there are no flags set on a file
> ?When I printed the value I got "flags = 0x0"
> I can use the value 0x0 to know that there are no flags set on the file. But
> I do not want to hard code such a value. The stat.h file does not define any
> value for this. What should I do in this case ?I am writing an example
> program to print flags set on a file.
0x0 (ie, zero expressed in hexadecimal) by definition means 'no
flags'. it's a pretty safe bet that you'll be able to rely on this for
the foreseeable future.
M.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden