how can i get sectors locations related to a file in C/C++

I want to know how can i get the sectors details related to a single file by giving it's inode number or something.
You can use an ioctl call with parameter FS_IOC_FIEMAP to get its extent map.
This isn't supported by all file system, but it works with ext4 in any case.
Taking a look at the filefrag source code should help getting to know how to use the calls.
Nobody said thanks to you Athar. So I'll say it.. Thanks.. =) I'm just a newbie here
Topic archived. No new replies allowed.