| Stephane CHAZELAS 2007-10-22, 1:27 pm |
| 2007-10-22, 06:10(-07), Boltar:
> Hi
>
> I'm interested in find out the various inodes that make up the bits of
> file I'm reading from. How can I get the current inode that the file
> descriptor is on/using? From my tests fstat() only seems to give the
> initial inode.
[...]
There's only one inode per file. There may be several data
blocks, That may be what you were thinking of but that's
something different.
How the file system is physically organised is something that is
lower level and that the user shouldn't have access to. If you
want to know the block addresses in FSs that organise files in
blocks, you'll have to use an API specific to your filesystem
(if any is provided). For instance for an ext2/3 FS, you can use
the libe2fs API. The debugfs command for instance allows you do
get the list of blocks for a given inode.
--
Stéphane
|