Get file sector location

Based on the file name or file descriptor, is there a Win-API way to determine in which physical sector the file starts?

+3
source share
4 answers

You can get the distribution of a cluster of files by sending FSCTL_GET_RETRIEVAL_POINTERS using DeviceIoControl.

+7
source

You will need to read the distribution table directly.

+1
source

, .

, , ? , , - .

, , .

0

No. What for? Because the file system is an abstraction of physical hardware. You do not need to know if you are on a RAM disk, hard drive, CD or network drive, or if your data is compressed or encrypted - Windows will take care of these small details for you.

You can always open a physical disk, but you will need information about the file system you are using.

What are you trying to do with this?

-3
source

Source: https://habr.com/ru/post/1703425/


All Articles