Direct access to hard disk with no FS from C program on Linux

后端 未结 3 2177
天涯浪人
天涯浪人 2020-11-30 06:18

I want to access the whole hard disk directly from a C program. There\'s no FS on it and never\'s gonna be one.

I just want to open /dev/sda (for example) and do I

3条回答
  •  失恋的感觉
    2020-11-30 06:57

    As device files for drives (e.g. /dev/sda) are block devices, this means you can open, seek and use the file almost like a normal file.

提交回复
热议问题