Gentoo Archives: gentoo-dev

From: purslow@×××××××××.ca
To: gentoo-user@l.g.o
Cc: Gentoo Devt <gentoo-dev@l.g.o>
Subject: [gentoo-dev] rm tragedies: a modest suggestion
Date: Mon, 31 May 2004 06:35:55
1 040530 Thorsten Kampe wrote:
2 > * Christian Gut (2004-05-30 11:40 +0100)
3 >> oh well, and it should move everything to a recycle bin
4 >> and asking two times if you really, really want to delete something.
5 >> Hey, this is not windows.
6 > It has to do with security.
7 > Command line deletion is always more dangerous than GUI deletion
8 > because you cannot see and physically mark the files you want to delete.
9 > The problem is simply that computer and human beings behave differently
10 > when doing multiple things at the same time or for a long time.
11 > Computers don't care how long they've been uptime,
12 > how many things they do simultaneously
13 > or if someone is disrupting their concentration.
14 > People do - and there is nothing to eliminate these things;
15 > just to put a barrier to the possible disastrous consequences.
17 these msgs seem to sum up the opposite sides of the debate.
19 the point i wanted to raise has nothing to do w novices, grannies or M$ :
20 it's something which can affect the most experienced red-blooded sysadmin
21 simply because for once in his life he's been working too long
22 & just before he collapses he enters a cmd w an extra space in it.
23 when machine guards, safety hats/boots etc were introduced in factories,
24 there were similar objections from old hands who "didn't need such things",
25 at least till they ended up in hospital missing a foot/hand/eye.
27 yes, there are good reasons not to alter the basic default behaviour of 'rm':
28 eg thousands of scripts exist out there which depend on it.
29 however, that doesn't mean that additional flags can't be added to it.
31 what is needed is a flag whose action lies between '-f' & '-i':
32 let's call it '-c' (for 'check': there are lots of spare letters to use).
33 'rm -f' & 'rm -i' would continue to do just what they always have done,
34 but unlike '-i', which asks re each file/dir individually
35 -- which is why people don't want to use it for big deletions -- ,
36 '-c' would ask just once for the whole set:
37 it would show the list (after expansion by the shell) & the starting dir,
38 with a request for confirmation like that offered by Zsh; for extra safety,
39 the user would have to type 'yes', not just 'y', to confirm deletion.
40 to allow easy aliasing of 'rm -c' as 'rm', 'rm -c' wd ask for confirmation
41 just when multiple files were listed or the list was a directory
42 -- esp this would apply when '*' was expanded by the shell -- ,
43 but not when there was only 1 matching file (not a dir).
45 this sb enough to alert the guy who's been working 30 hr ,
46 but would have no effect on all those thousands of scripts,
47 which wd continue to work with 'rm -f' just like now,
48 & no-one wb forced to use '-c', if they were willing to take the risk.
50 "But that's not POSIX !" -- nor is the GNU 'rm' now used by Gentoo,
51 which has a couple of extra flags which POSIX doesn't know about.
53 so is there any reason -- apart from developer time -- this can't be done ?
55 --
56 ========================,,============================================
57 SUPPORT ___________//___, Philip Webb : purslow@××××××××××××××.ca
58 ELECTRIC /] [] [] [] [] []| Centre for Urban & Community Studies
59 TRANSIT `-O----------O---' University of Toronto
61 --
62 gentoo-dev@g.o mailing list


Subject Author
Re: [gentoo-dev] rm tragedies: a modest suggestion Todd Berman <tberman@g.o>
Re: [gentoo-dev] rm tragedies: a modest suggestion Christian Gut <cycloon@×××××××.org>
Re: [gentoo-dev] rm tragedies: a modest suggestion Christian Gut <cycloon@×××××××.org>
Re: [gentoo-dev] rm tragedies: a modest suggestion Bernd Petrovitsch <bernd@××××××.at>