Maverick Meerkat
Maverick Meerkat

Reputation: 6424

Can I access and change my iNode values of a file?

I know that files in unix systems are represented by their inodes. files in unix

Can I as a user have access to these values and change them?

I'm asking this in the context of file manipulation in C (I want to write a program that appends to the beginning, or middle part of a file, and not just to the end).

Upvotes: 0

Views: 851

Answers (1)

tofro
tofro

Reputation: 6073

The user has read access to some of this information using the stat() system call provided he has proper access rights to the directory containing the inode.

The information can only be changed indirectly (timestamps, for example, by accessing the file itself). There is no direct way to mess with this information.

Some file systems might give a bit more access possibilities by exposing some of the information in ioctl() calls. What might or might not be exposed is a decision of the driver/file system developer.

Upvotes: 1

Related Questions