• 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
NSFileManager, 10.3.x and /tmp: bug?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSFileManager, 10.3.x and /tmp: bug?


  • Subject: NSFileManager, 10.3.x and /tmp: bug?
  • From: Stéphane Sudre <email@hidden>
  • Date: Sun, 16 Jan 2005 14:50:05 +0100

Let's say I am running Mac OS X 10.3.x.
Let's say I just booted it and I'm logged under user-id 501 and /tmp/501 does not exist.
Let's say I'm calling the following code from a Cocoa application built with ProjectBuilder.


NSString * tTempPath;
BOOL isDirectory;
NSFileManager * tFileManager;

tTempPath=[NSString stringWithFormat:@"/tmp/%d",getuid()];

tFileManager=[NSFileManager defaultManager];

if ([tFileManager fileExistsAtPath:tTempPath isDirectory:&isDirectory]==NO)
{
if ([tFileManager createDirectoryAtPath:tTempPath attributes:nil]==NO)
{
NSBeep();


         return NO;
     }
}

Is there any rational reason why the first time this call is called, the code goes to NSBeep() and when it's called again, the code works?

I tried this code on Mac OS X 10.2 and didn't see any such absurd phenomenon.
I tried resolving /tmp instead of creating the file directly, the bug still occurs.
I looked at /tmp (/private/tmp if you prefer), the permissions are allowing anyone to create a folder (drwxrwxrwt).


Any idea?


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: NSFileManager, 10.3.x and /tmp: bug?
      • From: The Karl Adam <email@hidden>
  • Prev by Date: Find panel tutorial?
  • Next by Date: Re: Changing Bundle Name
  • Previous by thread: Re: Find panel tutorial?
  • Next by thread: Re: NSFileManager, 10.3.x and /tmp: bug?
  • Index(es):
    • Date
    • Thread