Read a single sector from a disk

后端 未结 4 763
梦毁少年i
梦毁少年i 2020-12-10 07:27

I am trying to read a single specific sector from the disk directly. I\'ve currently run out of ideas and any suggestions how to go about it would be great!

4条回答
  •  旧时难觅i
    2020-12-10 08:05

    The other folks have pretty much covered it. You need to

    • access to the disk's device file (either be root or, better, change the permissions on it)

    • use the file IO functions to read sectors = chunks of (usually) 512 bytes from said disk.

提交回复
热议问题