fileExistsAtPathreturns NO for an existing directory. If I have the following code:
NSURL *newDirectoryPath = ...
BOOL directoryExists = [self.fileManager fileExistsAtPath:[newDirectoryPath absoluteString]];
if (NO == directoryExists)
{
BOOL ret = [self.fileManager moveItemAtURL:self.currentPresentationDirectoryPath toURL:newDirectoryPath error: &err];
directoryExists = [self.fileManager fileExistsAtPath:[newDirectoryPath absoluteString]];
}
Although the directory has just been successfully created with moveItemAtURL, it fileExistsAtPathstill returns NO.
I know the documentation says the following:
Attempting predicate behavior based on the current state of the file system or a specific file in the file system is not recommended. This can lead to odd behavior in the case of a race condition file.
, : , fileExistsAtPath , , Organizer, .. ..
P.S. fileExistsAtURL: ?