• 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
Re: Renaming and moving files
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Renaming and moving files


  • Subject: Re: Renaming and moving files
  • From: Chris Parker <email@hidden>
  • Date: Fri, 8 Mar 2002 13:03:08 -0800

On Friday, March 8, 2002, at 12:09 PM, Ondra Cada wrote:

Chris,

Chris Parker (CP) wrote at Fri, 8 Mar 2002 10:42:49 -0800:
CP> >They differ. movePath:toPath: does always copy (actually I think it's a
CP> >grave bug, but there might be reasons which I've missed).
...
CP> movePath:toPath:handler: copies to allow graceful error recovery for
CP> copies, basically. If something goes south, the original should be
CP> present in its untouched form.

Which is exactly what rename does, is it not?

...with no feedback whatsoever. There are cases where just a rename(2) occurs where appropriate (I've been tinkering lately, so this is frontmost...). But in cases where it might fail (i.e. the copy actually has to be performed) you can use the error dictionary given to the handler object to get more information.

If Andreas is seeing odd behavior on the local volume, then something else is wrong.

Perhaps I am wrong, and shame on me if so, but I've always thought that
rename is an atomic operation, which can only succeed (in which case the new
name exists and is all right), or fail (in which case the original name
exists and is all right). At the very least, I haven't ever encountered
anything else.

No, you're not wrong as far as rename(2) goes. If there are other problems in NSFileManager that I'm not aware of, I'm more than happy to hear about them.

.chris

--
Chris Parker <email@hidden>
Cocoa Frameworks Engineer
_______________________________________________
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.

  • Prev by Date: Re: Complete Cocoa API Reference posted to Apple Developer Site
  • Next by Date: Re: Preventing application icon from appearing in the dock
  • Previous by thread: Re: Renaming and moving files
  • Next by thread: Complete Cocoa API Reference posted to Apple Developer Site
  • Index(es):
    • Date
    • Thread