i-node problem

First , thank you for reading the post.

I Use Digital Unix 4.0F .

I get an i-node number of a text file using stat() function . I want to read the file context following the i-node information . But I do not know how to read disk information accroding to i-node information .

If you used stat, you had the path of the file. You need to use that path to open the file so you can be it.

There is no system call to read a file by inode number. If you also had the inode generation number, it would be possible to forge a nfs filehandle and read the file via nfs, assuming it was exported. But stat() won't return that.

It is possible to open the block special file of the filesystem, go read the real inode, and then chase down the data blocks. The code required varies greatly from filesystem to filesystem. The program "backup" does this. You can find the source code for "backup" if you poke around.