What sort of information would a file handle structure be expected to store?
I know a plain old number will be returned to the application, but what internally would need to be stored?
I have a FS/IO system that will now mount an I/O device (at the moment just using a ram based device) and map pages into a IO cache. Now I have come to create the open/read function calls. Done the open one, including a filename/path parser but I have come to write the open() function but am stumped as to what information I will need to keep track of.
Anybody jog my memory???
Thanks
Daryl.
File handles
- Pype.Clicker
- Member

- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:File handles
your file handle will collect everything further read/write will need such as the inode (or first cluster ID in case of a FAT or any other control structure) block identification on the disk, the list of actually cached blocks and their location in memory, the position of the file pointer (block and offset) ...
It could also be collecting access rights (a code for block allocations policy, a disk quota identifier, whatever)...
It could also be collecting access rights (a code for block allocations policy, a disk quota identifier, whatever)...