Linux Knowledge Summary (ii)

Source: Internet
Author: User

1. Fundamentals of file operations across file systems

In this way, we will be able to explain why the files can be manipulated across files and systems in Linux. For example, copy a file from a VFAT-formatted disk a.txt to a EXT3-formatted disk named B.txt. This includes two procedures for reading the a.txt and writing to the B.txt. Before reading and writing operations, you need to open the file first. As the previous analysis shows, when you open a file, the VFS will know the file system format of the file, and the VFS will invoke its corresponding actual file system operation method later when the file is manipulated. Therefore, the VFS calls Vfat's Read file method to read the A.txt data into memory, after the a.txt in-memory data is mapped to the b.txt corresponding memory space, the VFS call ext3 Write file method b.txt to disk, thus achieving the final cross-file system replication operations.

1-1. The realization of all documents "is fundamental

Whether it is an ordinary file, or a special directory, equipment, etc., VFS will treat them equally as files, through the same set of file interface to manipulate them. When you open a file, the VFS will know the file system format of the file, and when the VFS passes control to the actual file system, the actual file system makes a specific distinction and performs different operations on different file types. This is the essence of "everything is a document".

650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M02/9B/2C/wKioL1lfFMiiTWheAAC4tAyO6ms640.png "title=" Vfs.png "alt=" Wkiol1lffmiitwheaac4tayo6ms640.png "/>


This article is from the "UVN2015" blog, make sure to keep this source http://10851095.blog.51cto.com/10841095/1945261

Linux Knowledge Summary (ii)

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.