Reading Data from a Physical Hard Drive

后端 未结 2 1864
南笙
南笙 2020-12-20 10:24

I am trying to develop a program that goes and finds 2 connected unformatted physical drives and read bytes. The program currently runs in the administrator mode since that\

2条回答
  •  半阙折子戏
    2020-12-20 11:18

    It's imperative I can read sizes that's not multiples of 512.

    That is not possible. For direct access of a disk, you can only read and write multiples of the sector size. Furthermore, you must align your read and write operations. That is the file pointer must be at a multiple of the sector size.

    If you want to present an interface that allows arbitrary seeking, reading and writing, then you will need to implement your own buffering on top of the aligned raw disk access.

提交回复
热议问题