News for hackers. Stuff that matters.
Re:Your File System Is Already A Graph Database by stared on Wednesday April 08, 2026 @08:16AM (#47689152)
Filesystem is a tree - a particular, constrained graph. Advanced topics usually require a lot of interconnections.

Maybe it is why mind maps never spoke to me. I felt that a tree structure (or even - planar graphs) were not enough to cover any sufficiently complex topic.

Re:Your File System Is Already A Graph Database by vinaigrette on Wednesday April 08, 2026 @12:14PM (#47692247)
Isn't text a basic linear structure that can cover sufficiently complex topics ?
Re:Your File System Is Already A Graph Database by stared on Wednesday April 08, 2026 @12:27PM (#47692440)
Yes. And precisely for this reason reading a dictionary is not a way of learning a language.
Re:Your File System Is Already A Graph Database by nutjob2 on Wednesday April 08, 2026 @08:23AM (#47689211)
If it has hard or soft links, its a proper graph.
Re:Your File System Is Already A Graph Database by zahlman on Wednesday April 08, 2026 @08:42AM (#47689396)
On Linux at least, hard links can't be made to directories, except for the magic . and .. links. So this only allows for a DAG.

Symbolic links can form a graph, and you can process them as needed using readlink etc. to traverse the graph, but they'll still be considered broken if they form a cycle.

Re:Your File System Is Already A Graph Database by Retr0id on Wednesday April 08, 2026 @09:24AM (#47689928)
Considered broken by what?
Re:Your File System Is Already A Graph Database by rleigh on Wednesday April 08, 2026 @10:22AM (#47690642)
Historically, it made deletion rather difficult with some problematic edge-cases. You could unlink a directory and create an orphan cycle that would never be deleted. Combine that with race conditions on a multi-user systems, plus the indeterminate cost of cycle-detection, and it turns out to be a rather complex problem to solve properly, and banning hard-links is a very simple way to keep the problem tractable, and result in fast, robust and reliable filesystem operations.
Re:Your File System Is Already A Graph Database by Retr0id on Wednesday April 08, 2026 @10:26AM (#47690720)
GP was talking about symlink cycles though, which can't produce orphans during deletion.
Re:Your File System Is Already A Graph Database by rleigh on Wednesday April 08, 2026 @10:50AM (#47691037)
True, I missed that. I suppose with symlinks you have the reverse problem: you can point to deleted filenames and then have broken links. The cycle detection is still an issue though--it has indeterminate complexity and the graph can be modified as you are traversing it!
Re:Your File System Is Already A Graph Database by Retr0id on Wednesday April 08, 2026 @11:29AM (#47691574)
This is true, but just about everyone has a symlink cycle on their system at `/proc/self/root`, and for the most part nobody notices. Having a max recursion depth is usually more useful than actively trying to detect cycles.
Re:Your File System Is Already A Graph Database by zahlman on Thursday April 09, 2026 @12:42AM (#47699344)
As in, they'll appear highlighted as broken symlinks when running `ls` with colour enabled (or at least it's so on my system).
Re:Your File System Is Already A Graph Database by PunchyHamster on Wednesday April 08, 2026 @03:37PM (#47695211)
I guess technically you could do bind mounts but that's messy
Re:Your File System Is Already A Graph Database by calgoo on Wednesday April 08, 2026 @08:40AM (#47689376)
That what i was thinking! Instead of Wiki links, use Symlinks (i guess windows would not like it?)