I was wondering if there is an easy way to obtain the numbers of the blocks that a specific file is stored to in minix. eg stat() has the information of how many blocks a specific inode has but not the addresses of the actual blocks.
Asked
Active
Viewed 786 times
1
-
Your tags say `unix`, but on GNU/Linux, you can use the `blocks` command in the `debugfs` program. It uses the `ext2fs_block_iterate3` function in [e2fsprogs](http://e2fsprogs.sourceforge.net/) - a couple hundred lines of C. – Mark Plotnick May 17 '16 at 17:27
-
i am interested in using this function in my syscall. do i only pass the inode number as parameter, and does this return an array pointer? – lord boobies May 17 '16 at 18:04
-
Sorry, didn't know you wanted kernel code. The user-mode `ext2fs_block_iterate3` function takes as args structures representing the filesystem, inode, flags, and a pointer to a function to process the results. There may be an analogous function in the Linux kernel - try adding the `linux-kernel` tag to your question to get more people to help. – Mark Plotnick May 17 '16 at 18:19
-
forgive me i haven't clarified my intentions. i have been searching for a single paradigm of what i am trying to achieve here and i got nothing.I am looking for something as plain as it gets. i read about debugfs before though so i think, im on the right track. thank you for your tip. – lord boobies May 17 '16 at 18:28