Extended Attributes (OS/2 Style) in Linux file systems

Booting, installing, newbie
Post Reply
Message
Author
DrDeaf
Posts: 69
Joined: Sat 30 Dec 2006, 14:10

Extended Attributes (OS/2 Style) in Linux file systems

#1 Post by DrDeaf »

Since this is a basic question about the capability of the various Linux file systems, I hope this is the correct Forum.

OS/2 v2 and up had a concept of Extended Attributes which included a feature "Comments" which was a free field where anything could be placed. An entire directory set of files could be listed out with comments in a terminal session and redirected to a text file so that a key word(s) could be searched and a particular file located quickly.

Also, the WPS offered the option to right click and select to display the Comments for that particular file.

Many other things I miss about OS/2 but this particular function was very useful.

Is there any file system and configuration of Linux which will allow this? OBTW, I am running Fatdog64 and want to make it work with that.
TIA

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#2 Post by musher0 »

Already an edit! May 7th 2013, p.m.

Changelog
This newer script checks for directories -- and will not allow comments for directories. (shucks :) ) We'll see later if it's possible to do it elegantly... In the meantime, it's no.

Allows for some localization.

Also indicates date in shorter, more human, form.

~~~~~~~~~~~~~
Hello, DrDeaf.

I haven't found anything in Linux like the OS/2 function you describe.
In Linux, we have an utility called "file", it does provide info about a file, but one cannot add a comment. There are a couple of others, but none satisfactory for your purpose.

So, I created this little script. It is a "Commentator". :)
What it does is indicated in the comment lines.

It's a console program, I hope you won't mind.

In short,
go to the directory where the desired file is located, and
type

Code: Select all

lsnote <file> w 
to write in a comment.

The date is prepended, as well as the semi-long ls entry for the file.
Every time you'll edit this file, the new date will be indicated automatically.

If you just want to read your comment, type
lsnote <file>.

There's a manual-edit option to view the file with the less reader
rather that in the console.

Enjoy!

musher0

PS. A proper pet package will follow in a minute.

[Please see version 0.3b a few posts down. Thanks. you.]
Attachments
lsnote.jpg
Example with the dillo web browser. The date is indicated here in French, but the script is programmed to indicate it in the language you usually use.
(13.55 KiB) Downloaded 395 times
Last edited by musher0 on Thu 09 May 2013, 14:30, edited 2 times in total.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

DrDeaf
Posts: 69
Joined: Sat 30 Dec 2006, 14:10

#3 Post by DrDeaf »

Thank you very much Musher0! :D

If you are familiar with OS/2 (?) I hope you don't mind a couple of questions about the behavior of "Commentator".

In OS/2 v2 & up, the Extended Atributes are handled 2 ways, depending on file system (FAT or HPFS).

With HPFS the "Comment" Attribute was attributed directly with the file. IOW essentially a comment field that could hold anything, text, a REXX script (non-executable), etc, and was contiguous to that file.

With FAT, the Extended Attributes were held in a separate file (EAdata.sf) in Root and indexed to the appropriate files throughout the data structure.

So, in either file system the Extended Attribute would follow the file wherever it went.

Questions:

1 Does your script generate a comment that will follow the file in some way? Perhaps in a manner described above?

2 One more thing... Linux generally can use many different file systems. Is this "Commentator" file system agnostic? (excluding FATs, only Ext(x), JFS, XFS, etc...)

OBTW, if you have an interest, Smokey01 has a utility, "Right-click-64-5.9.8.pet" that I installed to look at and I discovered that down in the menu is a function that will open a CLI in whatever desktop window is active. If you are familiar with the OS/2 Workplace Shell you have seen this before. Paired with your script, this promises to recreate one of the most handy things I liked.

Best regards, and thanks again!

User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

Keepnote

#4 Post by don570 »

The closest thing to file organization I know about in linux
is an old freeware program called Keepnote

http://keepnote.org/

It kept all the notes organized, but at the same time
it stored each note as a separate html or XML file on your hard disk.

This allowed each separate note to be accessed by a file manager
and further edited if you wanted.

I'm sure that there are other programs that are similar.

Several programs are available to organize images.
Puppy has geequie and gqview available.

____________________________________________________

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#5 Post by musher0 »

DrDeaf wrote:Thank you very much Musher0! :D

If you are familiar with OS/2 (?) I hope you don't mind a couple of questions about the behavior of "Commentator".

In OS/2 v2 & up, the Extended Atributes are handled 2 ways, depending on file system (FAT or HPFS).

With HPFS the "Comment" Attribute was attributed directly with the file. IOW essentially a comment field that could hold anything, text, a REXX script (non-executable), etc, and was contiguous to that file.

With FAT, the Extended Attributes were held in a separate file (EAdata.sf) in Root and indexed to the appropriate files throughout the data structure.

So, in either file system the Extended Attribute would follow the file wherever it went.

Questions:

1 Does your script generate a comment that will follow the file in some way? Perhaps in a manner described above?

2 One more thing... Linux generally can use many different file systems. Is this "Commentator" file system agnostic? (excluding FATs, only Ext(x), JFS, XFS, etc...)

OBTW, if you have an interest, Smokey01 has a utility, "Right-click-64-5.9.8.pet" that I installed to look at and I discovered that down in the menu is a function that will open a CLI in whatever desktop window is active. If you are familiar with the OS/2 Workplace Shell you have seen this before. Paired with your script, this promises to recreate one of the most handy things I liked.

Best regards, and thanks again!
Hello, DrDeaf.

Glad I can be of help and thanks for your questions.

Answers, in no order:

I'm not familiar with OS/2. The above script was rather inspired by a vague recollection of an old XtraDOS utility called fileinfo (from 25-30 years ago ?).

I surely can give the script right click access. Just give me a little more time?! :)

The script is disk-agnostic, it is linked to a particular file, not a file-system.

The comment can't follow the main file automatically. As I said, it's not a file-system feature, it's simply a text file like so many others, but describing a particular file or executable.

But if you move the main file, you could use the asterisk with cp.
Something like

Code: Select all

cp dillo* /usr/local/bin 
will probably carry the dillo file and its comment to /usr/local/bin.

You can put any type of text in this *.note file, even a database, if you feel like it. But it's meant to be only a memo to oneself. So if you wish to have an executable affecting the main file, you should write, test and store it in a proper *.sh or *.pl or *.py, etc., executable script. This little *.note description file is not the place for an "executable as executable". (As I said, you can store anything in it, but it will never be an executable. It's not supposed to!)

As you can see, it's nothing as sophisticated as what can be found in OS/2.
I hope it helps nevertheless.

TWYL.

musher0
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

jamesbond
Posts: 3433
Joined: Mon 26 Feb 2007, 05:02
Location: The Blue Marble

Re: Extended Attributes (OS/2 Style) in Linux file systems

#6 Post by jamesbond »

DrDeaf wrote:Since this is a basic question about the capability of the various Linux file systems, I hope this is the correct Forum.

OS/2 v2 and up had a concept of Extended Attributes which included a feature "Comments" which was a free field where anything could be placed. An entire directory set of files could be listed out with comments in a terminal session and redirected to a text file so that a key word(s) could be searched and a particular file located quickly.

Also, the WPS offered the option to right click and select to display the Comments for that particular file.

Many other things I miss about OS/2 but this particular function was very useful.

Is there any file system and configuration of Linux which will allow this? OBTW, I am running Fatdog64 and want to make it work with that.
TIA
Be prepared to read.
http://linux.die.net/man/5/attr
http://linux.die.net/man/1/setfattr
http://linux.die.net/man/1/getfattr
1. Tools is CLI only.
2. Tools only work on mounted partitions, not "/" because "/" is aufs and aufs doesn't support extended attributes.
3. Make sure ext2/3/4 is mounted with "user_xattr" option (I think this is the default).
4. You cannot name attributes arbitrarily - see the first URL. An attribute name "user.comment" will work.
5. Works with ext2/3/4 and NTFS - haven't tested with others.
6. Good luck.
Attachments
attr-2.4.46-8.pet
Download, open rox folder and click to install. Do not install directly from browser.
(19.91 KiB) Downloaded 150 times
Fatdog64 forum links: [url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Latest version[/url] | [url=https://cutt.ly/ke8sn5H]Contributed packages[/url] | [url=https://cutt.ly/se8scrb]ISO builder[/url]

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#7 Post by musher0 »

Hello again, DrDeaf.

Here's a no fuss right-click version. As compared to the console script above, it adds a line of basic info provided by the "file" utility.

Another difference is that you can go back and forth between the reader and the editor, until you're satisfied with your comment and finally press 'q' in the reader.

[Please see version 0.3b, a few posts down. Thank you.]

I hope this fits your need.

Best regards.

musher0
Last edited by musher0 on Thu 09 May 2013, 14:28, edited 1 time in total.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

DrDeaf
Posts: 69
Joined: Sat 30 Dec 2006, 14:10

#8 Post by DrDeaf »

Thanks again, Musher0. :D
I want to build a NAS, and I am in the planning stage and developing ideas of how I can make it what I want.
I will give this a try!

DrDeaf
Posts: 69
Joined: Sat 30 Dec 2006, 14:10

Re: Extended Attributes (OS/2 Style) in Linux file systems

#9 Post by DrDeaf »

jamesbond wrote: 2. Tools only work on mounted partitions, not "/" because "/" is aufs and aufs doesn't support extended attributes.
.
Hi Jamesbond! Thanks for the informative response. Before I posted this thread, I had no success trying commands involved in extended attributes for linux. First thing of course I went to the terminal and entered "help (commandname)" expecting to see the arguments available for that but always got returned "command not found".
Frustrating....

#2 above sheds some light on that...

So, since aufs does not support EAs, the related commands are not present? If so, I infer that the pet you referenced will install and enable EA commands required to mount and use an EA capable file system? If so, I would appreciate a pointer to that pet. I have searched for it but I must not know the correct location.

JFS is a linux port of HPFS so I was interested in that, and having read a bit about EAs in the various file systems, it appeared that EAs were much more capable in XFS as well.

However, GParted for FatDog64 has "greyed out" both JFS and XFS as format choices. Something I don't understand here, so is there a problem using these file systems?

Again, I appreciate your response and I hope you don't mind a few more questions!
Thanks in advance, :D
Edit1: Ooops! Didn't have my view set wide enough and missed the link to it. Thanks! :oops:
Edit2: Yep, so far so good. Thanks for the tools! JFS & XFS still "greyed out" for GParted....
Last edited by DrDeaf on Wed 08 May 2013, 03:30, edited 2 times in total.

DrDeaf
Posts: 69
Joined: Sat 30 Dec 2006, 14:10

Re: Keepnote

#10 Post by DrDeaf »

don570 wrote:The closest thing to file organization I know about in linux
is an old freeware program called Keepnote

http://keepnote.org/
Thanks don570. You didn't mention it but it's always nice to find a cross-platform app. Worth noting!
In the feature list I notice "file attach" listed and this might be a "tail wags the dog" way of doing what I want. I will look at it some more....
Thanks again! :D

disciple
Posts: 6984
Joined: Sun 21 May 2006, 01:46
Location: Auckland, New Zealand

Re: Extended Attributes (OS/2 Style) in Linux file systems

#11 Post by disciple »

DrDeaf wrote:Before I posted this thread, I had no success trying commands involved in extended attributes for linux. First thing of course I went to the terminal and entered "help (commandname)" expecting to see the arguments available for that but always got returned "command not found".
That only works for internal shell commands i.e. commands that are part of Bash or Busybox (whichever it is). It does not work for external commands, i.e. ones which are their own separate executable.
You could have tried something like `getfattr --help` or `getfattr -h`. On a normal linux you would also do `man getfattr` or `info getfattr`, but that doesn't work on Puppy as it isn't included.

BTW, while you can't use eas in / when running Puppy from CD or frugal install, I think you should still be able to use them in the save file if you navigate into it via /initrd/pup_rw
Do you know a good gtkdialog program? Please post a link here

Classic Puppy quotes

ROOT FOREVER
GTK2 FOREVER

User avatar
Karl Godt
Posts: 4199
Joined: Sun 20 Jun 2010, 13:52
Location: Kiel,Germany

#12 Post by Karl Godt »

Edit2: Yep, so far so good. Thanks for the tools! JFS & XFS still "greyed out" for GParted....
Last edited by DrDeaf on Today, at 05:30; edited 2 times in total
jfs is not supported in the various puppy scripts like pup_event_frontend_d, partview, pmount and others ..

xfs is 80% supported : most scripts support it, some not .

jfs and xfs utils you have to fetch from somewhere precompiled or as source and compile self .

Have reiser[fs|4], jfs and xfs compiled on my side, still have to check gcc for BSD fs source Makefiles ie ufs or zfs .

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#13 Post by musher0 »

Hello, DrDeaf and all.

The attached version (0.3) of lsnote allows comments for folders as well as any type of file. Please disregard the previous versions.

It works from right-click in a ROX-Filer panel. To access it, use right-click -> OpenWith -> lsnote-clic2.

You can copy the symbolic link located at ~/.config/rox.sourceforge.net/OpenWith within any sub-folder in
that directory. Then the "File & Folder Commentator" utility will be available directly for the file corresponding to this type.

Enjoy!

musher0
~~~~~~~~~
Edit, beginning of evening: one code typo corrected, localization possibility included.
Attachments
lsnote-0.3b.pet
Handy File &amp; Folder Commentator, with localization capacity.
(1.84 KiB) Downloaded 176 times
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

jamesbond
Posts: 3433
Joined: Mon 26 Feb 2007, 05:02
Location: The Blue Marble

Re: Extended Attributes (OS/2 Style) in Linux file systems

#14 Post by jamesbond »

DrDeaf wrote:Hi Jamesbond! Thanks for the informative response.
And thanks for the response back. All too often I respond to a question and the original poster doesn't even bother to reply back ... so kudos to you !
So, since aufs does not support EAs, the related commands are not present?
Okay, let me put it this way:
You need getfattr and setfattr programs to access the EAs - it is in the pet I posted earlier. Without these programs you can't access the EA, period.
Now, assuming you have installed the programs, they will only work on a filesystem that supports EA. "aufs" - the root filesystem used by Fatdog and Puppy, does *not* support EA so no matter what you do you can't get/set EA to the files under the "/" filesystem (you can try, you will get an error if you do so).

As disciple said earlier, the underlying aufs branch layer (e.g. the savefile) *does* support EA. If find that confusing you need to read this: http://distro.ibiblio.org/fatdog/web/fa ... ystem.html. But it is rather pointless because unless you want to access the branch directly (*not recommended* way of access!), you still can't get the EA from the "/".
If so, I infer that the pet you referenced will install and enable EA commands required to mount and use an EA capable file system? If so, I would appreciate a pointer to that pet. I have searched for it but I must not know the correct location.
Yes. Pet is attached in my previous post :lol:
However, GParted for FatDog64 has "greyed out" both JFS and XFS as format choices. Something I don't understand here, so is there a problem using these file systems?
As explained by disciple, you need to find the corresponding JFS tools (or JFS utils) and XFS tools / XFS utils. We don't include them in Fatdog because, well, they are not the "common" filesystem used by home users. Once you install these utilities, Gparted will automatically enable the menu. Since Karl already got them compiled, he may be able to you (pointing finger at Karl :twisted: )

cheers!
Fatdog64 forum links: [url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Latest version[/url] | [url=https://cutt.ly/ke8sn5H]Contributed packages[/url] | [url=https://cutt.ly/se8scrb]ISO builder[/url]

DrDeaf
Posts: 69
Joined: Sat 30 Dec 2006, 14:10

#15 Post by DrDeaf »

musher0 wrote: The attached version (0.3) of lsnote allows comments for folders as well as any type of file. Please disregard the previous versions.
Thanks again, Musher0 :D
(hmm, I wonder why the counter didn't tick up when I downloaded?)
Cheers!

DrDeaf
Posts: 69
Joined: Sat 30 Dec 2006, 14:10

Re: Extended Attributes (OS/2 Style) in Linux file systems

#16 Post by DrDeaf »

jamesbond wrote:Yes. Pet is attached in my previous post :lol:
Yes, as I mentioned in "Edit2" I did enlarge my window and see the download link :oops:
First time I have downloaded anything from the Forum so I just had not really noticed before.
jamesbond wrote:JFS tools (or JFS utils) and XFS tools / XFS utils. We don't include them in Fatdog because, well, they are not the "common" filesystem used by home user
:wink: I fully understand that...
jamesbond wrote:Once you install these utilities, Gparted will automatically enable the menu. Since Karl already got them compiled, he may be able to you (pointing finger at Karl :twisted: )
I'm on my way! And thanks again! :D

DrDeaf
Posts: 69
Joined: Sat 30 Dec 2006, 14:10

#17 Post by DrDeaf »

Karl Godt wrote:jfs is not supported in the various puppy scripts like pup_event_frontend_d, partview, pmount and others ..
xfs is 80% supported : most scripts support it, some not .
jfs and xfs utils you have to fetch from somewhere precompiled or as source and compile self .
Have reiser[fs|4], jfs and xfs compiled on my side, still have to check gcc for BSD fs source Makefiles ie ufs or zfs .
I don't know where to start! Well, to begin, all I've done in this area is read. I have been away on a trip for a few months, but when I am back "in country" soon and have easy access to a good hardware selection again I want to build a NAS. Do you have experience with Nas4Free? You mentioned UFS/ZFS and that is where I connect UFS/ZFS in my reading. I had not read of it being available for Linux.
Thanks to jamesbond I have the tools for the client side and they seem to work AFAIK. Need to build and format the NAS before I can play any further. Letting a NAS handle the EAs will work with FD64 the way I have it now... yes?
I do have a notebook that should handle compiling quickly enough. I never have done that and I suppose I will need to install a hard drive...
Any tips or reading you can point me to for getting started?
Thanks in advance!

User avatar
Karl Godt
Posts: 4199
Joined: Sun 20 Jun 2010, 13:52
Location: Kiel,Germany

#18 Post by Karl Godt »

Hmmm .. Dunno anything about NAS
http://en.wikipedia.org/wiki/Network-attached_storage
.
That wants to use NFS .


UFS and ZFS are BSD filesystems . Puppy kernel by default should support ufs ( and probably some more uncommon ) :
insmod /lib/modules/2.6.33.2/kernel/fs/ufs/ufs.ko
in Lupu kernel 2.6.33.2
though not included in the initrd.gz, so won't boot from that.

My current ufs status looks like this :
http://packages.debian.org/source/squeeze/ufsutils
.orig.tar.gz and applied the .diff.gz
my dpup has bsd headers in the main.sfs and I have to install some the bsd-kernel headers, which can break other /usr/include/sys headers .


and ERRATA : apparently due to be compatible with "mut probepart", pmount probably is the only script that supports all filesystems identified by guess_fstype ( and blkid ( or disktype ) ) due to grep -v 'none' .

DrDeaf
Posts: 69
Joined: Sat 30 Dec 2006, 14:10

#19 Post by DrDeaf »

Karl Godt wrote:Hmmm .. Dunno anything about NAS ......
UFS and ZFS are BSD filesystems .
NAS4Free is based on FreeBSD.
Karl Godt wrote:Puppy kernel by default should support ufs ( and probably some more uncommon ) :
Understood... My environment is a bit different.
Karl Godt wrote:My current ufs status looks like this :
http://packages.debian.org/source/squeeze/ufsutils
.orig.tar.gz and applied the .diff.gz
my dpup has bsd headers in the main.sfs and I have to install some the bsd-kernel headers, which can break other /usr/include/sys headers .
Thanks!
Off to study some more!

Post Reply