Messages in this thread | | | From | (Stephen Harris) | Subject | Re: PROPOSAL: /proc/dev | Date | Wed, 7 Jan 1998 22:29:14 GMT |
| |
Robert Bihlmeyer (robbe@orcus.priv.at) wrote:
: Perhaps there is a real use for scanning the /dev directory, and I : just can't think of one...
Just off the top of my head...
# get a list of the first sector of all the hard disks on my machine... # ignore device errors, since we don't have that device! # Many known bugs here, but none that affect the point I'm making!!! cd /dev for a in hd* sd* xd* do dd if=$a of=/tmp/$a bs=1 count=512 2>/dev/null done
Now, I may have a SCSI disk that is not normally mounted (it could have a different OS on it), and so the sd.o module isn't loaded, and so sda doesn't exist under your scheme and so I will miss some data.
This is a specific example of a general case: *searching* the system for devices that are available, but not in use. -- Stephen Harris sweh@spuddy.mew.co.uk http://www.spuddy.org/
The truth is the truth, and opinion just opinion. But what is what? * Meeeeow ! Call Spud the Cat on > 01268 515441 < for free Usenet access *
| |