When a user asks for multiple read/write or other operations on a file, each time it starts from the directory being retrieved. In order to avoid repeatedly retrieving the directory, the "open" File system call is introduced in most of the OS, and the first time a user requests a file for operation, the file must be opened using the open system call. The so-called "open" means that the system will name the attributes of the file (including the file's physical location on the external memory), copy it from the external memory to a table in the Memory open File table, and return the table destination number (or index number) to the user. In other words, "open" is to establish a connection between the user and the specified file. Thereafter, the user directly obtains the file information through the connection, thus avoids the retrieval of the file through the directory again, that is, when the user sends a file operation request to the system again, the system can find the file information directly in the Open file table according to the index number provided by the user. This not only saves a lot of retrieval overhead, but also significantly improves the speed of the file operation. If the user no longer wants to perform the appropriate action on the file, you can use the Shut down system switch to close the file, i.e. disconnect the connection, and the OS will remove the file from the table in the Open File table.
Why is "open" a file system call introduced in most OSes? What is the meaning of open?