fileExistsAtPath: NO means YES?
fileExistsAtPath: NO means YES?
- Subject: fileExistsAtPath: NO means YES?
- From: Dave Hersey <email@hidden>
- Date: Thu, 08 Apr 2004 14:20:56 -0400
Hi,
I have an app that needs to check for the "non-existence" of a folder, and
the documentation raises questions regarding the usefulness of
NSFileManager's fileExistsAtPath method for this.
From the docs:
---------------------------------------------------------------------
fileExistsAtPath
Returns YES if the file specified in path exists, or NO if it does not. If
path specifies a symbolic link, this method traverses the link and returns
YES or NO based on the existence of the file at the link destination. If
path begins with a tilde, it must first be expanded with
stringByExpandingTildeInPath, or this method will return NO.
---------------------------------------------------------------------
By this documentation, fileExistsAtPath will return NO if a broken link
(which is after all still a file) exists at the path. If *any* file can
exist when a NO value is returned, I don't see how you can have confidence
in a negative result from this method.
I need to know for certain that nothing exists at the path. Should I be
using FSPathMakeRef and checking for fnfErr, or is there a way to do this
using Cocoa frameworks?
Thanks,
- Dave
_______________________________________________
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.