• 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: Andy Lee <email@hidden>
  • Date: Tue, 4 Jul 2006 21:11:44 -0400

On Jul 4, 2006, at 12:07 PM, Sean McBride wrote:
Yes, yes, movePath:toPath:handler: can be used, but if you look
at its docs (which we've been over carefully now) you'll see the word
'rename' appears nowhere. And if one is not familiar with the (bizarre)
unix concept of 'moving' a file to rename it, then it's not at all clear
that this API can be used. And if you search the Cocoa docs and even
the Cocoa headers for 'rename' you come up pretty dry. This is quite
discouraging.

I usually sing the praises of Cocoa's consistent and intuitive naming, but I agree here. It should be trivial to find out how to rename a file by searching for "rename file". If you do this search in Xcode's Documentation window, you get nothing about the movePath method.


movePath only does what we normally think of as renaming a file in one special case: when the original path matches the new path, except for the last component. However, because this special case is a frequently desired one, I think the docs should mention it and use the word "rename" somewhere so it turns up in an Xcode search.

I think there should be a convenience method that can more naturally be described as renaming a file. Maybe something like -[FileManager renameFileAtPath:to:], where the second argument is not allowed to be a path. Of course, one can easily add this method in a category.

--Andy

_______________________________________________
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


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: Dean Snyder <email@hidden>)
 >Re: Changing file & directory names (From: Sherm Pendley <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: Derrick Bass <email@hidden>)
 >Re: Changing file & directory names (From: Sherm Pendley <email@hidden>)
 >Re: Changing file & directory names (From: "Sean McBride" <email@hidden>)

  • Prev by Date: Re: How do I move my running app?
  • Next by Date: Re: How do I move my running app?
  • Previous by thread: Re: Changing file & directory names
  • Next by thread: Re: Changing file & directory names
  • Index(es):
    • Date
    • Thread