Marka
Marka

Reputation: 387

Finding length of data block in sparse file

How can I find length of non-zero data block in sparse file starting from some offset? Do I have to make some file read or OS can read that information from some metadata which can be cached? I'm using Windows OS and Visual Studio C++.

Upvotes: 0

Views: 289

Answers (1)

atzz
atzz

Reputation: 18010

You can use DeviceIoControl with FSCTL_QUERY_ALLOCATED_RANGES command.

Upvotes: 1

Related Questions