Nick Redmark
Nick Redmark

Reputation: 747

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?

Upvotes: 6

Views: 1611

Answers (1)

Mat
Mat

Reputation: 206831

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.

Upvotes: 9

Related Questions