Re: File permissions - semi off topic
Re: File permissions - semi off topic
- Subject: Re: File permissions - semi off topic
- From: "Alastair J.Houghton" <email@hidden>
- Date: Sat, 27 Sep 2003 14:03:09 +0100
On Saturday, September 27, 2003, at 01:04 pm, Darkshadow wrote:
One more gotcha - if you're using NSFileManager to get/set the
permissions for files, it actually uses *decimal* for the permissions
rather than the more familiar octal code.
No, it doesn't. It's *you* using decimal rather than octal;
NSFileManager just uses an NSNumber, stored (in binary) in the
computer's memory. If you want to write octal constants in a C
program, just prefix them with zero; so, for example
10 is ten
but 010 is eight
All C programmers should be aware of the syntax for octal constants,
because otherwise it is very easy to succumb to the temptation to write
tables of decimal numbers with leading zeroes (which will, of course,
not have the desired result).
Kind regards,
Alastair.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.