Re: Trashing files and undo

2008-07-14 Thread Sean McBride
On 7/12/08 11:49 AM, Charles Srstka said: >He's not referring to making an alias *file*, just an alias in memory. >To do that, you make an FSRef first as I described, then you use >FSNewAlias() with NULL as the first argument, a pointer to your FSRef >as the second argument, and a pointer to an Al

Re: Trashing files and undo

2008-07-12 Thread Charles Srstka
On Jul 12, 2008, at 2:25 AM, Ruotger Skupin wrote: Hi, if I get you right, you are suggesting I put an alias to the file into (say) ~/Library/Application Support/MyApp/UndoAliases/ remember the original path/filename then trash the file. To get it back I resolve the alias and move/rename

Re: Trashing files and undo

2008-07-12 Thread Gregory Weston
On Jul 12, 2008, at 3:25 AM, Ruotger Skupin wrote: Hi, if I get you right, you are suggesting I put an alias to the file into (say) ~/Library/Application Support/MyApp/UndoAliases/ remember the original path/filename then trash the file. To get it back I resolve the alias and move/rename

Re: Trashing files and undo

2008-07-12 Thread Gregory Weston
On Jul 12, 2008, at 3:25 AM, Ruotger Skupin wrote: Hi, if I get you right, you are suggesting I put an alias to the file into (say) ~/Library/Application Support/MyApp/UndoAliases/ remember the original path/filename then trash the file. To get it back I resolve the alias and move/rename

Re: Trashing files and undo

2008-07-12 Thread Ruotger Skupin
Hi, if I get you right, you are suggesting I put an alias to the file into (say) ~/Library/Application Support/MyApp/UndoAliases/ remember the original path/filename then trash the file. To get it back I resolve the alias and move/rename it. What's the advantage over the FSRef solution Ch

Re: Trashing files and undo

2008-07-12 Thread Ruotger Skupin
Hi Charles, let me make sure I understand that. I get the FSRef and the original path of the file and keep hold of the information before trashing it with performFileOperation. When I want it back, I resolve the FSRef and move it back to original location. Ruotger Am 11.07.2008 um 17

Re: Trashing files and undo

2008-07-11 Thread Ken Thomases
On Jul 11, 2008, at 11:11 AM, Charles Srstka wrote: At any rate, if you do the resolution immediately after performing the trash operation, this should prevent this situation from happening in the first place. I don't know if this ever happens in practice, but in theory performFileOperati

Re: Trashing files and undo

2008-07-11 Thread Gregory Weston
On Jul 11, 2008, at 11:49 AM, glenn andreas wrote: On Jul 11, 2008, at 10:44 AM, Gregory Weston wrote: Ruotger Skupin wrote: my app trashes files with -[NSWorkspace performFileOperation:source:destination:files:tag:] and NSWorkspaceRecycleOperation. This works flawlessly but users want u

Re: Trashing files and undo

2008-07-11 Thread Charles Srstka
On Jul 11, 2008, at 10:54 AM, Sean McBride wrote: Unless of course between trashing the file and trying to undo the trashing, a file of the same name as the trashed item is put in its old location. 1) that would cause the wrong alias resolution (since aliases resolve by path first) and 2) i

Re: Trashing files and undo

2008-07-11 Thread Sean McBride
On 7/11/08 10:49 AM, glenn andreas said: > >On Jul 11, 2008, at 10:44 AM, Gregory Weston wrote: > >> Ruotger Skupin wrote: >> >>> my app trashes files with -[NSWorkspace >>> performFileOperation:source:destination:files:tag:] and >>> NSWorkspaceRecycleOperation. This works flawlessly but users wan

Re: Trashing files and undo

2008-07-11 Thread Charles Srstka
On Jul 11, 2008, at 10:44 AM, Gregory Weston wrote: Drop-dead simple. FSFindFolder is your friend. Give it a volume reference number and tell it you're looking for the user's trash and it'll hand it back to you (creating it if necessary and you asked for that behavior). I think possibly a

Re: Trashing files and undo

2008-07-11 Thread glenn andreas
On Jul 11, 2008, at 10:44 AM, Gregory Weston wrote: Ruotger Skupin wrote: my app trashes files with -[NSWorkspace performFileOperation:source:destination:files:tag:] and NSWorkspaceRecycleOperation. This works flawlessly but users want undo. NSWorkspace does not seem to allow undoing said

Re: Trashing files and undo

2008-07-11 Thread Gregory Weston
Ruotger Skupin wrote: my app trashes files with -[NSWorkspace performFileOperation:source:destination:files:tag:] and NSWorkspaceRecycleOperation. This works flawlessly but users want undo. NSWorkspace does not seem to allow undoing said file operation (or any file operation for that matter)

Re: Trashing files and undo

2008-07-11 Thread Michael Watson
Note that if a file is on a secondary volume, and you move the file to the Trash, it doesn't get moved to ~/.Trash; you'll find it in the .Trashes directory on the root of the volume on which it resides. -- m-s On 11 Jul, 2008, at 10:42, Abernathy, Joshua wrote: ~/.Trash? -Original M

RE: Trashing files and undo

2008-07-11 Thread Abernathy, Joshua
~/.Trash? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] ] On Behalf Of Ruotger Skupin Sent: Friday, July 11, 2008 10:39 AM To: Cocoa-dev@lists.apple.com Subject: Trashing files and undo Hi, my app trashes files with -[NSWorkspace performFileOperation:source:desti