Firestom
April 6th, 2009, 11:04 PM
Welcome!
I have been looking trough API's to read CDRom drives, and have found none that works fine or suits my needs. I have then decided to try myself to read those CD drives.
Trough the command line I have tried:
cd /dev
ls -l | grep cdrom
And it returned:
lrwxrwxrwx 1 root root 4 2009-04-06 16:36 cdrom -> scd0
brw-rw----+ 1 root cdrom 11, 0 2009-04-06 16:36 scd0
crw-rw---- 1 root cdrom 21, 1 2009-04-06 16:36 sg1
I have to assume my CDRom drive is device scd0 and it is a block device.
Through basic C file management I have tried to read it with fgetc() and it returned EOF (-1) on scd0 and nothing in sg1. Good start.
I have then tried looking for documentation on the net, but they tend to explain in a very confusing. I can't even know what langauage are the codes for and which includes I need to make.
How can I read a block device using C (or C++) standard library?
I have been looking trough API's to read CDRom drives, and have found none that works fine or suits my needs. I have then decided to try myself to read those CD drives.
Trough the command line I have tried:
cd /dev
ls -l | grep cdrom
And it returned:
lrwxrwxrwx 1 root root 4 2009-04-06 16:36 cdrom -> scd0
brw-rw----+ 1 root cdrom 11, 0 2009-04-06 16:36 scd0
crw-rw---- 1 root cdrom 21, 1 2009-04-06 16:36 sg1
I have to assume my CDRom drive is device scd0 and it is a block device.
Through basic C file management I have tried to read it with fgetc() and it returned EOF (-1) on scd0 and nothing in sg1. Good start.
I have then tried looking for documentation on the net, but they tend to explain in a very confusing. I can't even know what langauage are the codes for and which includes I need to make.
How can I read a block device using C (or C++) standard library?