• 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: Best way to move a file out of the way?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Best way to move a file out of the way?


  • Subject: Re: Best way to move a file out of the way?
  • From: Marco S Hyman <email@hidden>
  • Date: Sun, 29 Mar 2015 23:04:35 -0700

> On Mar 29, 2015, at 10:51 PM, Daryle Walker <email@hidden> wrote:
>
>> An idea... move the destination file, if it exists, to the trash.
>> See NSFileManager's trashItemAtURL:resultingItemURL:error: to do that in a
>> safe manner.   Trash the old file then save the new.
>
> That was one of my suggestions. Sometimes, when I trash something when a long trash-emptying is already happening, a warning alert appears that says the newly trashed file will be directly deleted instead. I wonder if that alert still gets displayed when the trashing is programmatically instigated. That would be a surprise to the user since my program is a command-line tool (which may be called from a script someday).

I would not expect an alert, but I'm just guessing.  What I would expect is
an error return.   Shouldn't be too hard to create a very large Trash and
and some test code to see what happens in that situation.


_______________________________________________

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


References: 
 >Best way to move a file out of the way? (From: Daryle Walker <email@hidden>)
 >Re: Best way to move a file out of the way? (From: Marco S Hyman <email@hidden>)
 >Re: Best way to move a file out of the way? (From: Daryle Walker <email@hidden>)

  • Prev by Date: Re: Best way to move a file out of the way?
  • Next by Date: Re: Bug with Localized Failure Reason and file moving
  • Previous by thread: Re: Best way to move a file out of the way?
  • Next by thread: Storyboard warning: internationalization of (null)
  • Index(es):
    • Date
    • Thread