I just came across a VFS and a filesystem in userspace like FUSE.
Now, as far as I understand, it simulates a file system, so that an application can have a standard file system hierarchy. But I don’t understand, why do we need a separate file system for that? Can’t we just create a regular folder structure and place files which will be used by the app?
So, my questions are:
-
What is a VFS?
-
Can you give some real world examples, use cases where VFS is used.
-
What is the benefit of using a VFS?
Any Java based VFS?
VFS refers not to a ‘fake’ file system, but to the abstract filesystem interface presented by POSIX operating systems to application processes. Eg:
open()close()read()write()All filesystem implementations (ext3, XFS, reiserfs, etc.) expose that same interface on top of whatever specific structures and algorithms they use.
FUSE is a means of providing that interface with code that doesn’t run in the kernel. This can dramatically improve stability and security, since kernel code is privileged, while userspace code isn’t. That separation makes it much more sensible to write filesystems with lots of external dependencies. The FUSE web page describes many filesystems built using FUSE.