←back to thread

The File Filesystem (2021)

(mgree.github.io)
346 points wegwerff | 4 comments | | HN request time: 0.701s | source
Show context
PMunch ◴[] No.40220211[source]
Oh this is cool! I recently wrapped libfuse in Nim and after porting the 'hello' filesystem example I made one which is more or less exactly this. However my version you pipe data and have to provide a mountpoint, then when it's done it writes the result over stdout. That means you can inline it in a pipe chain but also that you have to make sure to grab the output.

At the moment I'm exploring other stuff which could be made into file systems. I've got a statusbar thing for the Nimdow window manager which allows you to write contents to individual files and it creates a bar with blocks on them as the output. It makes it super easy to swap out what is on your bar which is pretty neat.

Another tool I've made is a music player. It uses libvlc and when given a folder it reads all the media with ID3 tags and sets up folders like 'by-artist', 'by-album', etc. Each file is named as '<track number> - <song title>' and contains the full path to the actual file. To play a song you cat one of these files into 'control/current' and write the word play to 'control/command'. There's a bit more to it like that like a playlist feature and some more commands, but that's the basic idea. The goal is to have a super-scriptable music player.

replies(3): >>40221696 #>>40225800 #>>40227972 #
1. fishyjoe ◴[] No.40225800[source]
Would you mind sharing the Nim code? I've been interested in working with FUSE for a while, and use Nim for a few projects.

No worries if not, I'm just curious!

replies(2): >>40232331 #>>40233782 #
2. JNRowe ◴[] No.40232331[source]
Not PMunch, but bindings¹ and statusbar².

Nimble has a couple of fuse projects and wrappers registered too.

¹ https://github.com/PMunch/libfuse-nim

² https://github.com/PMunch/statusbar

replies(1): >>40233775 #
3. PMunch ◴[] No.40233775[source]
The audio player is unfortunately not on GitHub yet, I've still got a few kinks to work out before it's in a shareable state. The statusbar project was also shared mostly so the other Nimdow users could play around with it, so the code quality is quite sub-par.
4. PMunch ◴[] No.40233782[source]
JNRowe beat me to it! Feel free to browse the rest of my GitHub, its mostly Nim code. And if you want to talk Nim or Fuse you can join the Nim Discord server (or the Matrix or IRC bridge) or post on the Nim forum.