• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
can't rename file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: can't rename file
      • From: Wade Tregaskis <email@hidden>
  • Prev by Date: Re: High performance fade-in/fade-out of image
  • Next by Date: Re: if ([[NSUserDefaults preferences] check box]==true) ?
  • Previous by thread: Re: AltiVec programming? Mailing list?
  • Next by thread: Re: can't rename file
  • Index(es):
    • Date
    • Thread