Reading raw data from disc

I

Ivo Woltring

Dear Pythoneers,

Is it possible to read e.g. the first 3 sectors of a disc without opening a
file or somesuch?
I want to bitwise read a cd-rom or other media without consulting a table of
contents. Just start at track 0 and go on for x bytes. Is it possible with
python and if so, please help me in the right direction

thankx
Ivo.
 
G

Grant Edwards

Is it possible to read e.g. the first 3 sectors of a disc
without opening a file or somesuch?

Under Linux, no.

You have to open the device.
I want to bitwise read a cd-rom or other media without
consulting a table of contents. Just start at track 0 and go
on for x bytes. Is it possible with python and if so, please
help me in the right direction

sectorsize = 2048 # hard drives are usually 512, CDs 2K or 4K
bytes = file('/dev/cdrom','rb').read(3*sectorsize)

I've no idea what to do under Windows...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top