lkml.org 
[lkml]   [1998]   [Jan]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: PROPOSAL: /proc/dev
Date
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 *


\
 
 \ /
  Last update: 2005-03-22 13:41    [W:0.066 / U:1.264 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site