• 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: A mystery with NSFileManager
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A mystery with NSFileManager


  • Subject: Re: A mystery with NSFileManager
  • From: Jim Correia <email@hidden>
  • Date: Sat, 23 Feb 2002 18:45:27 -0500

On Saturday, February 23, 2002, at 06:39 PM, email@hidden wrote:

The following lines:

NSFileManager *fm = [NSFileManager defaultManager];
BOOL isDirectory;

NSLog(@"%@", [fm fileExistsAtPath:@"/tmp" isDirectory:&isDirectory] ? @
"YES" : @"NO");
NSLog(@"%@", isDirectory ? @"YES" : @"NO");

produce the output:

YES
NO

In other words, the -fileExistsAtPath:isDirectory: call returns success,
but the isDirectory flag is set to NO -- it claims /tmp is not a directory. Now, there's nothing wrong with /tmp on my machine; it's sitting right there, it conatins some spam files I've made over the past days, I have rwx access to it.

/tmp is a symbolic link

lrwxrwxr-t 1 root admin 11 Feb 23 18:22 tmp -> private/tmp


Is this a (bizarre) bug in NSFileManager, or am I missing something? Using @"/tmp/" returns YES for isDirectory

Got me.
_______________________________________________
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: sharing defaults between screensaver bundle and application
  • Next by Date: Re: A mystery with NSFileManager
  • Previous by thread: Re: A mystery with NSFileManager
  • Next by thread: Re: A mystery with NSFileManager
  • Index(es):
    • Date
    • Thread