Joined: 25 Oct 2004
Location: Cape Town, South Africa
|Posted: Wed May 04, 2011 9:03 am Post subject: POSIX extended attributes for tagging files
|I maintain a "Documents" directory, much like most. I categorize stuff using sub-directories. It strikes me that it would be a lot more convenient to store documents in a flat structure and tag each document with keywords. Are there any systems out there already that do this? If not, I was thinking this would be an ideal use of extended file attributes. Each file would get an extra extended file attribute "user.tags" which would be a string containing a space (or comma) separated list of tags.
There would be a few basic operations that need to be made convenient for
1) Specifying tags for an individual file, or collection of files:
Easy enough to do with a simple userspace utility, which can then be incorporated into most GUI file managers via plugins with relative ease.
2) Querying the tags on a individual file:
The is also a simple special case extension of the current ability of 'attr' to query the extended attributes on a file. What would be really useful is to have GUI file managers incorporate optional columns in directory listings that display the tags for each file listed. Simply clicking on the list of tags would then make the entire tag spec editable as a string.
3) Querying files by tag, including compound tag specification, e.g. "WashingMachine && Warranty" or "ProofOfPayment && Rent"
I think that ideally the 'ls' utility could be extended to include a "tag spec" command line argument that causes only those file names which match the taf spec to be outputted. Also, when -l is used, 'ls' should output a list of tags in brackets after the file name). Extending 'ls' would be a good first step maybe, but to include all the basic file management utilities (cp, mv, etc) perhaps it would be more useful to extend the globbing capabilities of various shells and the underlying C library to work with tag specs too, something along the lines of: *.pdf::ProofOfPayment+Rent; Considering the use of && and || already in many shells, '+' might be used for 'or', '~' for not, and '*' for 'and' (for example)
So what does everyone here think? Is this something others would want? Is this worth submitting as an RFC maybe? Obviously the technical details need to be looked, especially globbing syntax.
Adopt an unanswered post today