FileNote update

After a lot of googling and reading, I finally managed to set some "file
notes".
I found the following pages especially useful:

http://enterprise.linux.com/article.pl?sid=05/06/13/1352241&tid=113&tid=70&tid=89
http://www.freedesktop.org/wiki/CommonExtendedAttributes
http://www.squarebox.co.uk/cgi-squarebox/manServer/usr/share/man/man5/attr.5

Before attr, getfattr or setfattr would work, I had to add the user_xattr
flag to the drive's entry in /etc/fstab and umount/mount the partition. Then
I could define my own "file note" like this:

attr -s user.comment -V "Just testing..." my.txt
Attribute "user.comment" set to a 15 byte value for my.txt:
Just testing...

attr -g user.comment my.txt
Attribute "user.comment" had a 15 byte value for my.txt:
Just testing...

Whereas the "user." part is mandatory and the "comment" part is up to the
user to define.


Strangely enough, getfattr/setfattr and attr seem to be incompatible. Here's
what I got when I tried to read the previously with attr set
user.commentusing getfattr:

getfattr -n user.comment my.txt
my.txt: user.comment: No such attribute

So I guess I have to stick to either one of them.



Thanks to all who replied to my question and especially Ron Johnson, who set
me on track of the Extrended Attributes. Without your support I would never
have solved this problem.

Greetings, Manon.

Reply via email to