Re: Delete a file THAT big? Surely you are joking.

[prev] [thread] [next] [lurker] [Date index for 2006/12/18]

From: peter (Peter da Silva)
Subject: Re: Delete a file THAT big? Surely you are joking.
Date: 20:15 on 18 Dec 2006
> On Dec 18, 2006, at 1:03 PM, Peter da Silva wrote:
> > % sh longrunningprogram.sh > /tmp/stuff &
> > % rm /tmp/stuff
> > longrunningprogram.sh: output deleted -- core dumped
> > %
> >
> > Oh, that's definitely better!

> It's disengenius to present these as the only two options.

That's the option that was suggested. But, OK, let's try it your way.

% sh longrunningprogram.sh > /tmp/stuff$$ &
% rm /tmp/stuff$$
rm: /tmp/stuff12315: File open
% ls /tmp
stuff1419
stuff1420
stuff1466
stuff1501
...
stuff31718
% df /tmp
... 30k free
% rm -f /tmp/stuff*
% df /tmp
... 1.5G free

> Clearly it would be easy (and reasonable, I think) to have 'rm' at  
> least print a warning on stderr, if not require a -f flag to force,  
> for you to delete the last link to a file that's open for writing.   

I don't want "rm" to print a warning to stderr (let alone refuse to remove
a file) for an action that is almost always not merely harmless but desirable.

The point is that there is NO default that isn't sometimes. All software
sucks, all software is hateful. I believe the way a good UNIX environment
operates is less hateful than the alternatives I've used.

Generated at 03:01 on 20 Dec 2006 by mariachi 0.52