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

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-11 Thread Michael Watson
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:destination:files:tag

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

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

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)

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

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