• 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: Changing file & directory names
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Changing file & directory names


  • Subject: Re: Changing file & directory names
  • From: John Stiles <email@hidden>
  • Date: Sat, 01 Jul 2006 13:13:43 -0700



Sherm Pendley wrote:
On Jul 1, 2006, at 3:18 PM, John Stiles wrote:

Sherm Pendley wrote:
On Jul 1, 2006, at 1:41 PM, Dean Snyder wrote:

Greg Titus wrote at 10:26 AM on Saturday, July 1, 2006:

[[NSFileManager defaultManager] movePath:src toPath:dest
handler:handler];
Hope this helps!

From Apple documentation for NSFileManager movePath:

"If source is a file, the method creates a file at destination that
holds the exact contents of the original file and then deletes the
original file. If source is a directory, movePath:toPath:handler:
creates a new directory at destination and recursively populates it with
duplicates of the files and directories contained in source."


This is really heavyweight

No, it's not heavy at all - you've just misunderstood what it does. When the above says "creates a file at destination", it's talking about creating a new directory entry that points to the same data, not about copying the data.
I don't see any way that you could read this entry without interpreting it as "directories are copied element-by-element." There's no ambiguity at all.

It's done that way because link() cannot create a hard link to a directory. Even so, once the new directory is created, link() followed by unlink() are used to move files into it.


If that is the case, then clearly the documentation is incorrect. "Recursively populates it with /duplicates/ of the files" is clear as day. Hard links are not duplicates. There's vague, there's misleading and then there's just plain wrong---and I think we've gotten to the third category with this one.


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: Changing file & directory names
      • From: Sherm Pendley <email@hidden>
References: 
 >Changing file & directory names (From: Dean Snyder <email@hidden>)
 >Re: Changing file & directory names (From: Greg Titus <email@hidden>)
 >Re: Changing file & directory names (From: Dean Snyder <email@hidden>)
 >Re: Changing file & directory names (From: Sherm Pendley <email@hidden>)
 >Re: Changing file & directory names (From: John Stiles <email@hidden>)
 >Re: Changing file & directory names (From: Sherm Pendley <email@hidden>)

  • Prev by Date: Re: Changing file & directory names
  • Next by Date: Re: Changing file & directory names
  • Previous by thread: Re: Changing file & directory names
  • Next by thread: Re: Changing file & directory names
  • Index(es):
    • Date
    • Thread