
Dec. 29, 2014
11:19 p.m.
Andrew Barnert wrote:
you just look up the name of the trash directory (which I believe is theoretically localized but actually always ~/.Trash on the drive with your user directory, $mnt/.Trash otherwise) and call rename.
You may also need to invent a unique name if there's already a file in the trash with the same name.
And I don't know what the right thing to do on OS X would be for a file on a different filesystem than the user's home that doesn't have its own .Trash or is mounted read-only or no-trash.
Raising an exception would seem to be a reasonable thing to do in that case. -- Greg