• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: File permissions - semi off topic
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Prev by Date: Which Cell for NSProgressIndicator ??
  • Next by Date: Re: Passing arguments to an AppleScript?
  • Previous by thread: Re: File permissions - semi off topic
  • Next by thread: "/" character in application bundle identifier
  • Index(es):
    • Date
    • Thread