Is it possible to simulate files and directories in a file system?

I would like to be able to give the impression of the presence of files and directories (for example, the ls command should list them, or the cd command should make it possible to navigate directories), but redirect the reading, writing, deleting, .. commands to the program that processes them ( and, for example, saves, returns, deletes database data). Is it possible?

+5
source share
1 answer

This is possible if you write your own file system driver. The easiest approach is to use FUSE , which allows you to write drivers in user space (much safer and easier than writing a kernel driver).

Here is an example of hello world to get you started.

There is also a Wiki page about database file systems that you should look at.

+9
source

All Articles