1 / 9

Unix File Access

Unix File Access. Unix file access is accomplished via a series of tables Process file table System file table v-nodes (sometimes i-nodes) . File Access Facts. When an entry is allocated in a process’ file table, it is always the lowest numbered unused file descriptor

germain
Download Presentation

Unix File Access

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Unix File Access Unix file access is accomplished via a series of tables • Process file table • System file table • v-nodes (sometimes i-nodes)

  2. File Access Facts • When an entry is allocated in a process’ file table, it is always the lowest numbered unused file descriptor • File table entries can be shared among related processes • Symbolic links are files that hold another file path/name; direct analogy to pointers

  3. Process A Simple Version Process file table System file table File Pointer Each i-node has pointers into the data area 1 . i-node 0 i-node 1 i-node 2 Process B i-node 3 Process file table i-node 4 File Pointer 6 . 3 . same file! Process C Process file table Boot Super i-list block block file area File Pointer 1 .

  4. v-nodes & i-nodes • i-nodes contain the actual links to file data • UNIX inode • File attributes stored (size, time, ID, etc.) • 12 ptrs to direct blocks • 3 ptrs to 1, 2, 3 levels of indirection • Compromise between fast access for small file, # of levels of indirection (slower access) for larger files • v-nodes are used in virtual file systems, where remote file systems can be mounted

  5. v-nodes Client file system uses vnode as much as it would use inodes Purpose is to make access uniform, regardless of whether file/device is local or remote Abstract file location & details of access Virtual Node Layer Special device Local disk 1 Network file system Local disk 0

  6. i-node Why indirect? Permits more data blocks to be accessed

  7. Files open in a single process

  8. One File open in multiple processes

  9. Questions to Address in Class • What happens to a process’ file table on a fork? • What happens if a process with a pipe containing data calls fork()? • What do file tables look like when complex shell commands are executed? • How does dup2 affect the file table? • When are entries in the system file table shared? • What happens to fully buffered data if a fork occurs between buffering and output? • When is output fully buffered? • When are system file table entries shared, and when are inodes shared?

More Related