Scripsit ille Brian Wisti <brian / coolnamehere.com>:
> On Sunday, December 8, 2002, at 01:06 AM, Rudolf Polzer wrote:
> > Scripsit ille Rudolf Polzer <AntiATField_adsgohere / durchnull.de>:
> >> Scripsit ille Rudolf Polzer <AntiATField_adsgohere / durchnull.de>:
> >>> Scripsit ille aut illa Gavin Sinclair <gsinclair / soyabean.com.au>:
> >>>> From: "Rudolf Polzer" <AntiATField_adsgohere / durchnull.de>
> >>> [...]
> >>>>> ..bashrc:
> >>>>> | alias rm=recycle
> >>>>
> >>>> Nice.  CAn we have that in Ruby, please? :)
> >>>
> >>> My first attempt (it uses a configuration file in ~/.recycle which 
> >>> looks
> >>> like the following:
> > [...]
> >
> > There were some more changes, the current source is at
> > http://test.durchnull.ath.cx/recycle
> 
> This is neat stuff.  Why isn't it on the wiki yet? ;-)

Because it's not really done yet and I'm thinking about adding a feature
to automatically do a 'real' unlink if I'm trying to trash files in the
recycle bin or a subdirectory of it. If that's done, it can be a real
replacement of rm and the original rm could be renamed to - for example
- unlink. And a similar undelete tool would be nice since not everyone
who has ruby installed also has Perl and Larry's rename tool.

The -i option is IMHO not needed, therefore not implemented. But it's
trivial to implement - but I think listing the deleted file names is
enough.

UNIX question: can I assume that a file is always on the same device as
the directory it's in (then I could remove the file name portion and
call stat (not lstat! Directory symlinks must be resolved if doing this,
but file symlinks shouldn't because symlinks have to be deleted as
symlinks) which has the advantage that I can find out where a file would
be recycled to if it was there - good thing if I want to find a deleted
file using its original path)?

It doesn't break with all I know about mount (including Linux's --bind).

> Seriously, this is good, useful code.  It works as an example of 
> "Real-World" code, while at the same time it is small enough for hammer 
> on and improve.  Would you mind putting it on the wiki?

I'll do it once it's done.

> If you don't feel comfortable doing it yourself, I could always just 
> copy and paste your code.

Before some features have to be added (see the current file).


-- 
#!/usr/bin/perl -W -- WARNING: This will print 22,307 bytes! <strictsafe!>
use strict;for(my$y=-1;$y<1;$y+=.1){for(my$x=-1.9;$x<.4;$x+=.03){print'+';
my$X=my$Y=0;for(0..99){($X,$Y)=($X*$X-$Y*$Y+$x,2*$X*$Y+$y);print"\b "if$X*
$X+$Y*$Y>9;}}print"\n"};print''.reverse"\nHPAJ \a!rezloP .R yb torblednaM"