Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to simulate files and directories in a filesystem?

I would like to be able to give the impression of the presence of files and directories (e.g. the ls command should list them, or the cd command should make directory navigation possible), but redirect read, write, delete, ... commands to a program which handles them (and for example stores, returns, deletes data of a database instead). Is this possible?

like image 717
Nick Redmark Avatar asked Jun 05 '11 12:06

Nick Redmark


1 Answers

It's possible if you write your own filesystem driver. The easiest approach would be to use FUSE which allows you to write drivers in userspace (much, much safer and easier than writing a kernel driver).

There's a hello world driver example to get you started.

There's also a page on their Wiki about Database filesystems that you should look at.

like image 63
Mat Avatar answered Sep 30 '22 19:09

Mat