Re: More NSFileManager Issues
Re: More NSFileManager Issues
- Subject: Re: More NSFileManager Issues
- From: Vincent Habchi <email@hidden>
- Date: Mon, 29 Oct 2012 11:22:40 +0100
Since I am here…
Le 29 oct. 2012 à 10:56, Andreas Grosam <email@hidden> a écrit :
> With NSFileManager I've created a file in the temporary directory. Attempting to delete it, fails:
>
> NSFileManager* fm = [[NSFileManager alloc] init];
> NSLog(@"tmp file: %@", [_input1000 path]);
> BOOL isDirectory;
> if ([fm fileExistsAtPath:[_input1000 path] isDirectory:&isDirectory] || isDirectory) {
> NSError* error;
> if ([fm removeItemAtURL:_input1000 error:&error] == NO) {
> NSLog(@"ERROR: tear down testing environment with error: %@", error);
> }
> }
>
> Console:
>
> tmp file: /var/folders/m9/5p__qm3967qchc9_26tl85km0000gn/T/RelaxTest/input1000.txt
>
> ERROR: tear down testing environment with error: Error Domain=NSCocoaErrorDomain Code=4 "The file “input1000.txt” doesn’t exist." UserInfo=0x10011e700 {NSURL=/var/folders/m9/5p__qm3967qchc9_26tl85km0000gn/T/RelaxTest/input1000.txt}
Shouldn’t your URL (the one in the the error message just above) look like ‘file://var/folders…’ rather than a mere ‘/var/folders…’?
Viel Spaß,
Vincent
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden