Here’s an issue. I buy a lot of music—Bandcamp, in particular, is a beautiful moneyhole. So I have a lot of music. So it’s sometimes easy to lose track of a new album I want to play before I can play it eighty-seven times and get tired of it.
A similar issue: sometimes I only want to listen to jazz, or string quartets, or what I call “morning music”, and, when face-to-face with the list of every album and artist in my library, just can’t remember all those names.
A similar issue: sometimes I discover a painter I’d never heard of and fall in love and download all my favorite images of theirs so I can use them as my computer’s background. But what was that one’s name again? And which image had all those space whales?
Tags are a great way to attach arbitrary strings of meaning to files. And there are many tools out there to help with this. But I didn’t like any of those.
Here’s what I wanted:
So I wrote tagf
. It can associate tags with files and search those tags. That’s it. Search results are the absolute paths of the tagged files. And it’s simple and unix-y: it prints search results to stdout
, accepts input from stdin
so it can be used in pipelines, and stores tag data in plain text files.
It names and nests tag data files according to the files being tagged.
And tag data is stored in plain text files.
It’s not a perfect tool. For example, if you move the tagged files around, you’ll have to move the tag data files too. And, if you’re careless, you could pretty easily overwrite the tagged files with the tag files. But, on the other hand, you can move and edit and delete the tag data files with standard tools and your favorite editor. Just don’t mv ~/.file-tags/* /
.
So why not use extended attributes? In short, because xattrs aren’t guaranteed to travel across file systems or through compression, and there isn’t yet an easy way to add and search those attributes. At least not that I know of.
So anyway, if you’re into this kind of thing, maybe check it out.