Reading raw data from disc

Discussion in 'Python' started by Ivo Woltring, Dec 13, 2004.

  1. Ivo Woltring

    Ivo Woltring Guest

    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.
     
    Ivo Woltring, Dec 13, 2004
    #1
    1. Advertising

  2. On 2004-12-13, Ivo Woltring <> wrote:

    > 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...

    --
    Grant Edwards grante Yow! And furthermore,
    at my bowling average is
    visi.com unimpeachable!!!
     
    Grant Edwards, Dec 13, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Bichitra Patta nayak via .NET 247

    What is the difference between DISC and UUDI, When its is used

    Bichitra Patta nayak via .NET 247, Sep 15, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    934
    Bichitra Patta nayak via .NET 247
    Sep 15, 2004
  2. James
    Replies:
    1
    Views:
    412
    Bruce Barker
    Nov 3, 2005
  3. steve
    Replies:
    1
    Views:
    5,516
    brucie
    Nov 29, 2003
  4. Tom

    html on disc.

    Tom, Apr 4, 2004, in forum: HTML
    Replies:
    4
    Views:
    399
    Revd. Norle Enturbulata
    Apr 5, 2004
  5. Rob

    FAT32 Disc Access

    Rob, Apr 11, 2004, in forum: C Programming
    Replies:
    2
    Views:
    459
    Christopher Benson-Manica
    Apr 12, 2004
Loading...

Share This Page