Re: fileExistsAtPath: NO means YES?
Re: fileExistsAtPath: NO means YES?
- Subject: Re: fileExistsAtPath: NO means YES?
- From: Fritz Anderson <email@hidden>
- Date: Thu, 8 Apr 2004 14:29:39 -0500
fileExistsAtPath:isDirectory: "does not traverse final symbolic links."
-- F
On 8 Apr 2004, at 1:20 PM, Dave Hersey wrote:
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?
_______________________________________________
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.