0
  1. What is the correspondence/difference between file descriptors and open file descriptions?
  2. What is the correspondence/difference between file descriptions and inodes?
terdon
  • 242,166

2 Answers2

1

Off the top of my head... a file descriptor is a numeric reference held by a process which references an "open file description" in the kernel. The open file description holds information about which file is open, what mode (read/write) and where in the file the next read or write will be applied to.

Inodes are not directly linked to any process. They are a feature of the file system. They hold meta data such as file ownership. If a file has multiple file names (it has been hard linked) then it will still only have one inode.

ilkkachu
  • 138,973
-1

File descriptor is an element in the array which OS gives your application. You always have such array - OS creates it when starts a new process. OS often fills first three elements with pointers to stdin, stdout, and stderr.

Open file descriptor is an array element which points to some file. You call open(), OS looks for a an empty element in the array and use it. Conversely, closed/not opened file descriptor is an array element which is empty (or logically empty).

inode - unique (inside the drive) identifier for a file on that drive.

White Owl
  • 5,129