l i n u x - u s e r s - g r o u p - o f - d a v i s
L U G O D
 
Next Meeting:
January 6: Social gathering
Next Installfest:
TBD
Latest News:
Nov. 18: Club officer elections
Page last updated:
2005 Jan 06 17:19

The following is an archive of a post made to our 'vox mailing list' by one of its subscribers.

Report this post as spam:

(Enter your email address)
Re: [vox] fish?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [vox] fish?



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!
_______________________________________________
vox mailing list
vox@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox



LinkedIn
LUGOD Group on LinkedIn
Sign up for LUGOD event announcements
Your email address:
facebook
LUGOD Group on Facebook
'Like' LUGOD on Facebook:

Hosting provided by:
Sunset Systems
Sunset Systems offers preconfigured Linux systems, remote system administration and custom software development.

LUGOD: Linux Users' Group of Davis
PO Box 2082, Davis, CA 95617
Contact Us

LUGOD is a 501(c)7 non-profit organization
based in Davis, California
and serving the Sacramento area.
"Linux" is a trademark of Linus Torvalds.

Sponsored in part by:
Appahost Applications
For a significant contribution towards our projector, and a generous donation to allow us to continue meeting at the Davis Library.