Re: [SOLVED] createDirectoryAtPath anomaly between system versions?
Re: [SOLVED] createDirectoryAtPath anomaly between system versions?
- Subject: Re: [SOLVED] createDirectoryAtPath anomaly between system versions?
- From: Antonio Nunes <email@hidden>
- Date: Fri, 7 Jul 2006 15:01:11 +0100
On 7 Jul 2006, at 13:28, Nir Soffer wrote:
if ([paths count] > 0) {
myAppDirectoryPath = [[paths objectAtIndex:0]
stringByAppendingPathComponent:@"MySupportFolderTestApp"];
exists = [fileManager fileExistsAtPath:myAppDirectoryPath
isDirectory:&isDir];
if (!isDir) {
Since isDir is random value, your code will randomly works :-)
Thanks Nir but isDir is not used as an input variable, it is there to
hold a return value, and should upon return from fileExistsAtPath
hold whether the file is a directory or not. From Apple's documentation:
isDirectory
Upon return, contains YES if path is a directory, otherwise
contains NO. Pass NULL if you do not need this information.
I could imagine that isDir would be undefined if the file didn't
exist in the first place (exists == NO), although the documentation
implies otherwise, but that would still not explain how it
consistently holds the correct value (0 which equals NO ) in one
build configuration and consistently holds an incorrect value (64
which equals YES) in another build configuration upon return from the
fileExistsAtPath method when the file doesn't exist.
So my question remains: is this a bug or is there something going on
that I should know about?
-António
-----------------------------------------------------------
And you would accept the seasons of your
heart, even as you have always accepted
the seasons that pass over your field.
--Kahlil Gibran
-----------------------------------------------------------
_______________________________________________
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