Re: Devfs, was Re: Migrating to larger numbers

Cyrille Chepelov (chepelov_c@crans.ens-cachan.fr)
Wed, 9 Jun 1999 14:30:04 +0200 (CEST)


On Wed, 9 Jun 1999, Richard Gooch wrote:

> It is the right way. The concept is still valid. Just extend my
> example code. It wasn't meant to be complete, just enough to convey
> the idea. Did I really have to spell that out?

Why not improve slightly devfs to have subdirectories such as "cdroms" (by
classes of devices ["it's a CDROM"], not classes of interfaces ["it's a
cdrom which you plug through USB"]), which would contain symlinks to the
directories which might hold cdrom devices ?
(ie : /dev/cdroms having the following symlinks :
/dev/ide/cd
/dev/sr
/dev/usb/cd
...
)
Now, a program wanting to enumerate cdroms would just do something in the
lines of
for cddir in readdir("/dev/cdrom"):
for cd in readdir(cddir):
#do something useful
Whoopla, this is pretty much static, so it may very well belong to the tar
solution, devfsd or an init script.

-- Cyrille

------------------------------------------------------------------
camembert * reblochon * brie * roquefort * munster * corsu uru * port-salut

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/