Note that there are some explanatory texts on larger screens.

plurals
  1. POWhat are file descriptors, explained in simple terms?
    primarykey
    data
    text
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. COWhat about the concepts of stdin stdout stderr etc ? I have an instance like say browser process opened and it has opened some temporary files for displayed my html . The process uses the same fd to read / write ? Also the process table ....... it has entries like fd0 pointer fd1 pointer fd2 pointer ..... does that mean all these files are in RAM ? Why else pointers ?
      singulars
    2. COWhen you open a file, OS creates a stream to that file and connect that stream to opened file, the descriptor in fact represents that stream. Similarly there are some default streams created by OS. These streams are connected to your terminal instead of files. So when you write something in terminal it goes to stdin stream and OS. And when you write "ls" command on terminal, the OS writes the output to stdout stream. stdout stream is connected to your monitor terminal so you can see the output there.
      singulars
    3. CORegarding browser example, it is not necessary that browser keeps the files opened. It depends on implementation of browser but in most cases browser open a temporary file, write the file, and close the file, so its not necessary that the file is opened even if the web page is open. And descriptor just holds the information of the file and doesn't necessarily keep the file in RAM. When you read the data from a descriptor, the OS read the data from the hard-disk. The information in file descriptor just represents the location of the file on hard-disk etc..
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload