tags:

views:

123

answers:

1

I need raw read data from and write data into drive..not via existed filesystem like fat32 or something....i just wanna raw write read...... I was told in Windows i can use CreateFile WriteFile and ReadFile APIs to access data in drive directly... but I dont know in Linux whether there r similar functions....

dont tell me to use hardware driver programming, coz i am just a newbie in linux programming.. thanx a lot....

+1  A: 

Files /dev/hd* and /dev/sd*, depending on your setup, contain raw disk data. You need root account usually.

Use mount command to find out which disks/partitions are mapped to which files.

liori
But what r the functions? r they still like read() and write?
Macroideal
@Macroideal: yes. open/read/write should behave much the same as when used on regular files. For the most part on linux/unix, everything is a file.
Kjetil Jorgensen
i think you can also modify the permissions for those devices and use them as a normal useryou'll need to unmount that device before reading or writing to it directly.
Gautham Ganapathy
Macroideal, is "r" a verb? If so, what does it mean? I'm sorry, English is not my native language and my dictionary doesn't have it.
liori
@liori, "r" is a contraction of "are".
Colin Pickard