Reputation: 6424
I know that files in unix systems are represented by their inodes.
Can I as a user have access to these values and change them?
Say, replace the values between two adjacent blocks, and in this way change the file?
Can I overwrite only one block in the middle?
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
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