Re: changing file name when copying a file in the same directory
Re: changing file name when copying a file in the same directory
- Subject: Re: changing file name when copying a file in the same directory
- From: Jens Alfke <email@hidden>
- Date: Fri, 10 Jun 2011 12:22:01 -0700
On Jun 10, 2011, at 12:07 PM, Sandeep wrote:
> where in if a user copies a file in the same directory then a new file is created with the sufix Copy 1, Copy 2, Copy3 etc. can someone please let me know if we can implement the same using NSFileManager or if there are any methods that help in doing the same.
I don’t know of anything that will do this for you. Basically you have to write a loop where you try to copy the file, and if you get an error that the destination filename exists, you append the next suffix to it and try again.
—Jens
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden