Super User Asked by mogplus8 on December 29, 2021
I’m not very technical, just a humble user. What I’d like to do is have a way to add user defined attributes to a file, that I could then use to search on or control which files are displayed. e.g. add an attribute "foo" (for a file type like .pdf or .txt), and arbitrarily assign a value to "foo" for any file of that type, so I could display in a file list e.g. only files that have a "foo" attribute with a value of "bar". For me this would make finding and organizing things a heck of a lot easier.
I have discovered the "attr", "getfattr" and "setfattr" terminal commands that appear to do the first part of what I want. The second part though, accessing these attributes from within a file manager like Nemo or Nautilus doesn’t seem to be possible. I’ve searched for Nemo extensions, Nemo attributes, xattr, user_attr, all to no avail. Nothing I have found can access or display the extended attributes defined with the above commands.
I’m aware there are applications to manage particular file types like music, video, picture etc types that also have extended attributes, but they are bespoke aps that I’m assuming manage their attributes internally for the files and folders they have been given access to, and do not use the extended attributes functionality of the file system itself.
Have I missed something? Is it possible to access user attributes from within a stock file manager? All advice gratefully received
What you want are known as extended attributes on Linux (and many other UNIX-like systems), forks on macOS, and alternative data streams on Windows. Most platforms have support for this type of thing in some form or other, though it's often dependent on the filesystem supporting a way to store them (most you're likely to encounter do).
The thing is though, they tend to have very specific and limited usage in practice, largely because most people either don't want to count on them, or don't even know they exist.
Actual usage consists of:
Beyond that there's actually not much practical support for them. Most good backup and archiving tools support saving and restoring them, but most other user applications just ignore them, preferring to either use internal databases or inherent support for structured metadata that's built into the file formats (see below) to store metadata relevant to the files in question, as those allow them to work everywhere, not just on systems that support this at a filesystem level.
Edit in response to comments:
Most file formats that are not plain text, as well as some plain text file formats (such as HTML) support storing some form of structured metadata in the file itself. Usually, this is limited to metadata that's relevant to the type of data in the file (for example, for audio files this typically includes stuff like a track title, artist name, album name, and similar things useful for cataloging music), but some formats either allow free-form tagged data (for example, HTML technically allows for this with it's <meta>
tag in the document head) or a 'comment' tag that simply stores arbitrary text (ID3 and EXIF both have this, with it normally being used to store a text description of the media).
Trying to describe how these work here is not practical due to the huge variety of different approaches taken, but here are some links that include basic descriptions of what some of the more common ones do:
<head>
element is an example of how this type of metadata is handled in a plain text format. It's used in HTML documents to store the document title, arbitrary tagged metadata (including things like the document author or character encoding), and links to stylesheets, scripts, and other external resources relevant to the document.Note that in many cases, especially media files (images, audio, and video), some file managers support displaying the contents of specific well known and widely used metadata tags as part of the file listing. Windows Explorer for example can display most of the standard audio file tags (stuff like artist, album, and track names, track length, and track and disc numbers) in it's 'Details' view when showing audio files, and you can even sort on the contents of those tags.
Answered by Austin Hemmelgarn on December 29, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP