Page 1 of 1

Linux Extended Attributes - how are they managed????

Posted: Fri Oct 08, 2004 10:26 pm
by tom1000000
Hi,

I read on the web about the new Linux kernel having "Extended Attributes".

The only info I could find is basically how to read and set the extended attributes.

However their doesn't seem to be much info about their usage in the real world.

Extended attributes exist of name value pairs. But is their any list of standard names?

If one person creates an ea author="Jon Doe" and another person creates an ea writer="Jon Doe" how do "search" programs have any hope of matching them?

Then you could have the same attribute name eg author, but 2 different people could use different layouts eg "Jon Doe" or "Doe, Jon". How is that handled?

Another example - one file has ea bit_rate="128k" and another file has ea bitRate="128000". If you want to search your hard drive for all files with bit rate of 128k, how could it be done!?

Won't extended attributes become a big mess? If they can't be organised / searched then they become almost useless.

Re:Linux Extended Attributes - how are they managed????

Posted: Sat Oct 09, 2004 7:40 am
by Dreamsmith
tom1000000 wrote:Extended attributes exist of name value pairs. But is their any list of standard names?
Lots of them. For example, MIME types are something this is likely to be used for, and their are plenty of lists that document MIME types.
tom1000000 wrote:If one person creates an ea author="Jon Doe" and another person creates an ea writer="Jon Doe" how do "search" programs have any hope of matching them?
You would have to specify which fields you wish to search. In the above case, you would, unfortunately, have to say you want to search both "author" and "writer" fields for the information you're looking for.
tom1000000 wrote:Then you could have the same attribute name eg author, but 2 different people could use different layouts eg "Jon Doe" or "Doe, Jon". How is that handled?
Depends on the kind of data you're looking for -- in general, it's handled by knowing what kind of results you're likely to see and parsing accordingly.
tom1000000 wrote:Another example - one file has ea bit_rate="128k" and another file has ea bitRate="128000". If you want to search your hard drive for all files with bit rate of 128k, how could it be done!?
Quite easily. My /etc/bind/domain files sometimes specify time intervals like "86400", and other times like "1D" -- they both mean one day, just one is expressed in seconds and another is expressed in days. In your example, the bitrate can be expressed in bits or kilobits. This is a rather trivial problem to solve -- if it ends in a particular suffix, multiply accordingly.
tom1000000 wrote:Won't extended attributes become a big mess?
Possibly, but not necessarily.
tom1000000 wrote:If they can't be organised / searched then they become almost useless.
It would never be the case that they couldn't be organized and searched. However, the less standardized they are, the more non-trivial the task becomes...

Re:Linux Extended Attributes - how are they managed????

Posted: Mon Oct 11, 2004 2:42 am
by Pype.Clicker
well, if you want a "quick search" on some argument, you could consider building a database (DBM file ?) where their values are collected and simply insert two "extended attributes" to files in such case:
- the path to that database
- the key for the file within that database