Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!cbosgd!mandrill!hal!ncoast!allbery From: allbery@ncoast.UUCP Newsgroups: comp.cog-eng,comp.unix.xenix,comp.unix.wizards Subject: Re: Request for human interface design anecdotes Message-ID: <5733@ncoast.UUCP> Date: Sat, 21-Nov-87 11:52:57 EST Article-I.D.: ncoast.5733 Posted: Sat Nov 21 11:52:57 1987 Date-Received: Mon, 23-Nov-87 06:34:45 EST References: <101@ateng.UUCP> <1402@cuuxb.ATT.COM> <1689@rayssd.RAY.COM> <3032@phri.UUCP> Reply-To: allbery@ncoast.UUCP (Brandon Allbery) Followup-To: comp.cog-eng Organization: Cleveland Public Access UN*X, Cleveland, Oh Lines: 48 Xref: utgpu comp.cog-eng:299 comp.unix.xenix:1039 comp.unix.wizards:5158 As quoted from <3032@phri.UUCP> by roy@phri.UUCP (Roy Smith): +--------------- | In article <1689@rayssd.RAY.COM> dhb@rayssd.RAY.COM (David H. Brierley) writes: | > Just the other day I wiped out a weeks worth of work by typing | > "cc -o pgm.c" on my AT&T unix-pc. | | This may sound harsh, but I really have little sympathy in this | case. That zapping a source file wipes out a week's worth of work implies | that you don't make daily backups. Even on a PC, doing backups should be | routine every day; there really is little excuse for not doing so. +--------------- NO REASON?! When it takes 50 floppies to back up the HD, there is VERY MUCH a reason. (Tape? You got $1500 free to give me for a tape drive?) I back up my home directory, and if the disk crashes I just do a full reinstall. This is no slower than reloading lots of disks.... For the "rm" problem, I think I've got a solution. The idea comes from a cross between existing "rm/unrm" programs and fsck, and deals with links as well. (1) For every mounted filesystem PLUS the root, create a directory called "wastebasket" or some such. (2) The program "del" (NOT "rm" -- you'll screw up programs which invoke rm via system(), such as the System V spooler) links a file into the wastebasket directory for a filesystem by its inode number, and writes a line into an index file consisting of inum, path, and date and time. Maybe also the user who did it. (3) The program "undel" links the file back out of the wastebasket to its original path, via the index. (4) A program "expdel" (expunge deleted files) uses the index to choose files del'ed more than some specified or default time ago and unlinks them. By using rename() under BSD or SVR3, or using root privs under SVR2 or older, this can be generalized to directories as well, giving a safe rmdir as well. Note that this retains all links (except symbolic ones, but that's part and parcel of the problems with a symlink -- not to start THAT war again, but there isn't a whole lot to be done about it), and the expunge process does not have to search every user's home directory either. The result is a reversible rm which doesn't have any of the drawbacks of current ones. -- Brandon S. Allbery necntc!ncoast!allbery@harvard.harvard.edu {hoptoad,harvard!necntc,{sun,cbosgd}!mandrill!hal,uunet!hnsurg3}!ncoast!allbery Moderator of comp.sources.misc