[vox] fish?

Bill Kendrick nbs at sonic.net
Sun Jan 2 05:03:20 PST 2005


On Sat, Jan 01, 2005 at 05:17:30PM -0800, Michael Wenk wrote:
> The best implementation of rm I have seen was to replace the executable with a 
> script that copies the offending file to a .trash(with a corresponding cron 
> job that deletes files older than say 1 day) 

What happens when you do this, though?

  cd ~
  rm foo
  cd ~/programming/code/
  rm foo

Does the 2nd 'trashed' foo overwrite the first?
And if not, is there a way to tell which is which?


I'd guess the best way to do it would be to rename the files when moving
them to .trash, so that they'll be unique and easier to 'undelete',
e.g.:

  .trash/home_username_foo
  .trash/home_username_programming_code_foo

or perhaps even recreate the directory structure (rather than
just keeping track of it in convoluted filenames, like I did above):

  .trash/home/username/foo
  .trash/home/username/programming/code/foo


Of course, even here, what if you do:

  cd ~
  rm foo 
  some-program-that-creates-foo-again
  rm foo

Again here... does the 2nd "rm" cause the first 'trashed' foo to be
overwritten?

In this case, I think appending datestamps, or at least unique numbers, would
be helpful.


And in a GUI, one could simply show all of the files thrown together
(e.g., it would show multiple instances of 'foo', but it could expose the
metadata we know regarding where it's actually from, and which one it is)

e.g.:

  Filename:  Original location:               Last modified:  Deleted:
  foo        /home/username/                  2004/12/31      2005/01/01
  foo        /home/username/programming/code/ 2004/12/31      2005/01/01
  foo        /home/username/                  2005/01/02      2005/01/02
  foo        /home/username/programming/code/ 2005/01/02      2005/01/02

I'm just thinking of how I vaguely remember Mac OS 7.5 doing it.
(Not sure if it actually showed much details, but I'm almost positive the
trashcan could how multiple files, all with the same filename. (Folders, too))


-bill!


More information about the vox mailing list