Why is "open" a file system call introduced in most OSes? What is the meaning of open?

Source: Internet
Author: User

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?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.