Comment

Comment by amyjess

Oh, this looks really nice. Thank you for posting it!

A while back, I had an idea for modelling a filesystem as a dict, so maybe this will inspire me to get off my ass and actually write it.

Basically, the idea is that this:

    foo = rootfs['home']['amyjess']['stuff']['foo.txt']
    rootfs['home']['amyjess']['stuff']['bar.txt'] = bar
would be equivalent to this:

    with open('/home/amyjess/stuff/foo.txt', 'r') as foo_file:
        foo = foo_file.read()
    with open('/home/amyjess/stuff/bar.txt', 'w') as bar_file:
        bar_file.write(bar)
I really want to implement that now.
parent amyjess 10 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton