Write a simple FUSE filesystem that is stored in memory. The filesystem has to support the following commands:
ls, mkdir, cp
This question was recently asked in an interview, I wasn't able answer it. So I have decided to learn it.
Did some searching and found some guides on building my own FUSE filesystem. I am really clueless on how to implement the filesystem in memory.
My questions are
Links that I am reading:
In the last link the there is a mention on in-memory caching with PyFileSystem. I am not sure on how that might help.
PS : This was a written interview Question, So the answer has to simple enough to write on paper within 10-15 mins.
Filesystem in USErspace (FUSE) is a software interface for Unix and Unix-like computer operating systems that lets non-privileged users create their own file systems without editing kernel code.
FUSE (file system in user space) fixes #1 by providing a simpler, more uniform API. For example, in FUSE all operations take a full, absolute path (a path is absolute if it starts with "/"). There is no notion of relative paths. FUSE fixes #2 by running your file system code in user space rather than in kernel space.
I had taken a course where we had to build an in-memory distributed file system similar in design to Frangipani. The course was heavily inspired by MIT's Distributed Systems course. Doing their first few lab assignments would be a good exercise.
This tutorial is also quite helpful.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With