Even if /index.html" doesn’t exist in FS 2, FS 1 will not be searched for /static/index.html.Īs a general rule, mount point names must start with the path separator ( /) and must contain at least one character after path separator.FS 2 will be used when opening a file called /data/static/index.html.FS 1 will be used when opening a file called /data/log.txt.For instance, suppose that the following filesystems are registered in VFS: In case when mount points are nested, the mount point with the longest matching path prefix is used when opening the file. This prefix may be considered a “mount point” of this partition. All subsequent calls to C library functions for the returned FILE* stream will also be forwarded to the FAT driver.Įach registered FS has a path prefix associated with it. VFS component will then call open function of FAT driver and pass /file.txt argument to it (and appropriate mode flags). VFS also forwards read, write, and other calls for the given file to the same FS driver.įor example, one can register a FAT filesystem driver with /fat prefix, and call fopen("/fat/file.txt", "w"). When one of C library functions needs to open a file, VFS component searches for the FS driver associated with the file’s path, and forwards the call to that driver. At high level, each FS driver is associated with some path prefix. This component allows C library functions, such as fopen and fprintf, to work with FS drivers. This can be a real filesystems (FAT, SPIFFS, etc.), or device drivers which exposes file-like interface. Virtual filesystem (VFS) component provides a unified interface for drivers which can perform operations on file-like objects.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |