Hacker News new | past | comments | ask | show | jobs | submit login

Edit: ok, wow I didn't even check the link before writing my suggestion but it's kinda freaky how similar they are. Even used a scifi movie as the example.

I have a horrible idea that I haven't actually tried out, and I don't know how many filesystems it would work on anyway, but hard links...

Create a directory that holds your files. Organise them however you like - some arbitrary subdirectory structure using dates, names etc.

Create another top-level directory called "Tags", and build a directory structure that supports your needs.

Write a stupid "tag" shell script and a shell tab-completion script for it that lets you tag any item in the "real" directory structure using tab completion on the original file name and the tag. When you hit the return key the script creates a hard link for the original file in the chosen tag directory.

Example: tag "files/movies/the matrix.mkv" "tags/movies/sci-fi"

Now you can browse 'tags/movies/sci-fi'.

No "real" coding skills needed. You reorganize your tag directories and files by moving them around, and if you've done your shell scripts properly it shouldn't care as long as the top-level directories don't change. Limits? On Linux an inode can have up to 65000 hard links so I don't think it'll be an issue.

The many problems I see are name clashes, directories not supported (by hard links), cross file system links not supported (by hard links) and file deletions (don't work as expected). The tag script could handle the former. For deletions, you could create a "delete" that gets the file inode and deletes tags first, using 'find $tagsdir -inum $inode -delete'




> The many problems […]

…, hard-links are incompatible with programs that attempt "atomic" file saves instead of rewriting a file in-place, …




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: