3 ms·
It should be possible to mimic tags with folders & clever scripting that moves files around according to their "tags". Imagine a command like: tagmv file1
by fouc 5y ago
It should be possible to mimic tags with folders & clever scripting that moves files around according to their "tags".
Imagine a command like:
tagmv file1 file2 directory1 directory2 -t tag1 tag2 tag3
where it moves the files/directories to something like
~/t/tag1#/tag2#/tag3#/
Or instead of using "#" could use some other special/rare character/unicode to indicate that it is a "tag-directory".
The hierarchy of the tag-directories could ordered from the most common to least common tags. The most common tag, would have the tag-directory under the top level directory (something like ~/t/ to prevent confusion with the rest of the filesystem perhaps?).
The files & tag-directories could get re-organized every time the usage of tags changes, in order to keep the hierarchy from most common tags to least common.
A set of tools like tagmv, tagcd, tagls, etc could work with this tag-based structure.
Thoughts?
- mro_name 5y agoThere's a talk about such https://karl-voit.at/managing-digital-photographs/ https://karl-voit.at/managing-digital-photographs/, there's a video. Karl seems to have a fancy TUI, I made me a cmdline helper https://codeberg.org/mro/Tagger https://codeberg.org/mro/Tagger.
- fouc 5y agoI've seen that type of idea before, encoding tags within the file name. But as someone that lives in the terminal, I'm not a huge fan of cluttering up and making the file names so long.
- alpaca128 5y agoAlso this limits the number of tags that can be assigned to a file, with the limit varying between operating systems. But if you don't use filenames you have to store this tagging information externally, which has to stay in sync with file locations and ideally not be reliant on one specific program. There's folders + symlinks but I imagine that might be complicated to manage as well.
- fouc 5y agoI think it's possible to avoid using symlinks and just use plain folders to represent tags only. By using a special naming strategy on the folders themselves, it would be possible to have a set of scripts for "tagging" files and operating on them. Tagging would be equivalent to just moving the files into the relevant nested tag directories. No duplicate files or symlinks necessary.. Can make scripts like tagcd and tagls to make it work.
- alpaca128 5y agoI don't think that would scale. The nested directory structure could reach a depth equivalent to the number of tags to support all combinations. Meanwhile with symlinks you only need one folder per tag and it can be comfortably used with file browsers.
- fouc 5y agoIf there was a limit of 10 tags per file, then the max depth would be 10 folders.
- alpaca128 5y agoWith <20 tags per file you could just use the filename and not worry about more than filtering a bit using `find -iname`. With a filename limit of 255 bytes (Linux) that would still be ~12 characters per tag on average. I'd prefer not to worry about such limits though, with some files that don't allow full-text search it can be useful to have more.