Alan Gauld wrote:
I don't use Ubuntu so don;t know the standard anmswer
there but it will depend on where the CD is mounterd.
I usually mount cdroms on /dev/cdrom
That's what I figured; I now realize I didn't say so in my email, but it's
mounted at /dev/sr0, which is where I came up with that mount point.
t...@vraspberry:~$ df
. . .
/dev/sr0 614350 614350 0 100% /media/MP_04_074
MP_04_074 is the volume name.
But in python:
import os
for (r, d, f) in os.walk("/dev/sr0"): print r, d, f
...
for (r, d, f) in os.walk("/dev/sr0/"): print r, d, f
...
for (r, d, f) in os.walk("/dev/cdrom/"): print r, d, f
...
for (r, d, f) in os.walk("/dev/cdrom"): print r, d, f
...
for (r, d, f) in os.walk("/dev/cdrom0"): print r, d, f
...
for (r, d, f) in os.walk("/dev/cdrom0/"): print r, d, f
...
None of those work; but:
for (r, d, f) in os.walk("/media/MP_04_074"): print r, d, f
...
/media/MP_04_074 ['directory1'] []
(etc.)
What I can't figure out is how to do this if my program does not know the
volume name. I won't know the colume name in advance, and in fact, I'll
be processing one CDROM, replacing it and processing another, etc.
_______________________________________________
Tutor maillist - [email protected]
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor