Quoth Bakul Shah <ba...@iitbombay.org>: > On Feb 19, 2022, at 3:02 AM, sirjofri <sirjofri+ml-9f...@sirjofri.de> wrote: > > (4) A filesystem that filters a namespace, but the file contents and not > > the namespace. > > > > The idea is to have a filesystem like exportfs, however, it doesn't just > > represent the files as is, but applies user-defined filters to the > > filenames/paths as well as the file contents. > > > > Imagine you have a namespace which contains markdown files that end with > > .md. Using this overlay filesystem you can present the same namespace, but > > convert the filenames using sed (from .md to .html) and when reading, the > > file contents (from markdown syntax to html syntax). > > > > The filesystem would be very powerful for exposing plain text data as html, > > encapsulating data into some predefined layout, and much more. It could > > essentially make any plain text filesystem available as regular > > web-friendly html files, convert troff source to postscript, convert plan 9 > > images to png, and much more. You can even present device files as json for > > modern web applications. > > May be create a generic filter-fs that can be controlled with a script that > can be updated via a control interface? Almost a mkfile like script so if a > rule exists for .md -> .html, any listing will show foo.html instead of > foo.md. Reading foo.html will transparently invoke a conversion program. You > can get pretty clever and may be even install a src dir under /bin this way > to build binaries on the fly! Or even just the presence of a mkfile in a > filtered directory would be enough for this behavior. Taking this further, an > installation of a new machine can be made instantaneous! Just use a local > cache for all the binaries as they get built! Obviously this should be called > mkfs :-) >
See, for example, execfs, here: http://felloff.net/usr/cinap_lenrek/ I use it for https://shithub.us, though it has a number of limitations. Using it as a starting point, but replacing regexes on the path with a more powerful language, would probably get quite close to what's described here. ------------------------------------------ 9fans: 9fans Permalink: https://9fans.topicbox.com/groups/9fans/T745cda5087701a0d-M9791daa4c063f7ae31acf876 Delivery options: https://9fans.topicbox.com/groups/9fans/subscription