can't rename file
can't rename file
- Subject: can't rename file
- From: Kurt Marek <email@hidden>
- Date: Sat, 8 Nov 2003 19:32:36 -0800
I can't seem to rename a file.
if ([[NSFileManager defaultManager] movePath:[[self urlToFile]
absoluteString] toPath:newDirectoryAndFileName handler:nil]==NO) {
NSLog(@"didn't move");
}
urlToFile is an NSURL; newDirectoryAndFileName is an NSString
always give me this output:
2003-11-08 19:27:08.179 Scinece Library[1418] newdirrectory and file
name=file:/localhost/Users/username/Desktop/filename
2003-11-08 19:27:08.179 Scinece Library[1418] old file
name=file://localhost/Users/username/Desktop/oldfile
2003-11-08 19:27:08.179 Scinece Library[1418] didn't move
If I manually change it to the following it works fine:
if ([[NSFileManager defaultManager] movePath:@"~/Desktop/oldfilename"
toPath:@"~/Desktop/filename handler:nil]==NO) {
NSLog(@"didn't move");
}
Is there something about the "file:/localhost" part that is screwing it
up?
thanks,
kurt
_______________________________________________
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.