On Nov 23, 2008, at 2:33 PM, Nathan Kinsinger wrote:
On Nov 23, 2008, at 3:12 PM, Adam R. Maxwell wrote:On Nov 23, 2008, at 2:02 PM, Nathan Kinsinger wrote:It didn't find the file because you forgot to update the content array after creating the new file.Right, I rearranged things a bit and forgot that. However, that only matters if you create "Test file" (which doesn't change the case of the name listed in Terminal, so it's doubly odd that it changes NSFileManager's result).Comment out the second call to createFileAtPath:contents:attributes: and the result of contentsOfDirectoryAtPath: and fileExistsAtPath: still differ. That was the main thing I wanted to point out, anyway.-- AdamNSArray's containsObject: checks with isEqual:. So the difference is that NSStrings are case sensitive.
Yes, I know (and that's why I mentioned an array with custom callbacks might be useful). The point I was trying to illustrate is that if you're generating "unique" filenames and use contentsOfDirectoryAtPath:error: to see if a file exists, you can easily overwrite files.
-- Adam
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]