One of the advantages of the Unix philosophy inherited by Linux is that the file system is very modular.This is also good, because a typical system may need to choose a file system, such as ext4
, riserfs
, btrfs
, Even like a network system nfs
In addition, there are fake file systems, such as /sys
with /dev
Help Linux make everything look like a file. The disadvantage is that building the file system requires changing the kernel, or at least writing loadable modules. This is not as difficult as it sounds, but it is more difficult than writing ordinary programs. Then there is FUSE-the file system in user space. This is a single file system module that allows you to create a new file system by writing ordinary code.
My favorite fuse
Several FUSE file systems are very useful. Here are some of my favorites:
- sshfs-use only ssh to access and mount remote file systems
- rclone-Rclone can access and mount many remote file systems
- Tag Assistant -Store files with unique tag access method
- Fuse zipper – Mount the zip file
- gitfs -Mount with git
there are many other. You can find systems that can be used, such as NTFS and a large number of cloud service providers.
Where’s the window?
If this is a good idea, is there a Windows equivalent? right here. Winfsp It seems to be a good way to achieve the same effect under Windows, although it is not just plug-and-play compatible with FUSE. There is a FUSE compatibility wrapper that allows you to port existing FUSE code more easily. In fact, there are two FUSE wrappers, one for version 2.8 and the other for version 3.2.
This is a relatively new project, but there are Docan It also claims that their API has a FUSE wrapper.according to Winfsp
-Benchmarks are provided, however, Winfsp
Perform better.
so?
If you have a favorite FUSE system, it may be open source, if you want, you can try to port it to Windows. If you don’t use Windows and want to write your own FUSE systems, these systems provide you with a way to easily transfer your work to Windows.
For example, you may have a data logger and want to expose its data as a file system. It is not difficult to do. There is a data structure to fill in, you don’t have to fill in everything. You provide data structures that point to functions for reading and writing content (such as directory and file data).This is an Example in C. Or try C++ wrapper This enables you to write one with fewer lines of code. This example has only four simple functions.