Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Changing file & directory names



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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

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>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.