0

In order to not to run into an XY-Problem, here is the purpose I want to achieve:

I just want to have a folder with dynamically mangled names of an original source folder.

original folder:

webmaster@dev:~$ tree demo
demo
├── FileOne
├── FileTwo
└── FolderOne
    ├── FileOne
    └── FileTwo

folder with mangled names

webmaster@dev:~$ tree demo-symlinks/
demo-symlinks/
├── file-one
├── file-two
└── folder-one
    ├── file-one
    └── file-two

I do not want to touch the original source.
I dislike to watch the filesystem and run an update routine on each change. (This was my first approach in the past)
I want to have some instant reflection instead.

My idea is to setup or develop some virtual reflection filesystem similar to /proc or /sys and mount it on an empty folder.

The questions is not about the actual name mangeling, I can fit it to my needs on my own.
Actually, my question is:

How can I implement my own virtual filesystem? Since I do not have any clue how to start doing so, I need some first approach. Any basic C/C++ code example (or arbitrary languages) providing just the original names again would be fine. The nodes do not mandatorily have to be symlinks, I just want do access the original files by another name/path. Of course if there already is some installable ready-to-use solution, it would be preferable.

Any other solution achieving the desired points above is welcome.

Pinke Helga
  • 321
  • 1
  • 2
  • 10
  • You have to either write a kernel module or employ a user level approach such as [FUSE](https://en.wikipedia.org/wiki/Filesystem_in_Userspace). The latter is probably more appropriate in this case. But both of these topics are too broad though to be effectively covered in this forum so you probably need to do more research on your own and come back with more specific questions if needed. – kaylum Jan 18 '20 at 11:12
  • @kaylum An administrative approach would be fine. So the keywords are "filesystem kernel module"? Any other hint to find exactly what I need? – Pinke Helga Jan 18 '20 at 11:16
  • I gave you a link to FUSE. Would start there and do further searches on FUSE. – kaylum Jan 18 '20 at 11:16
  • @kaylum Many thanks so far! – Pinke Helga Jan 18 '20 at 11:20

0 Answers0