Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Sat 23 Aug 2014, 07:47
All times are UTC - 4
 Forum index » House Training » Beginners Help ( Start Here)
Extended Attributes (OS/2 Style) in Linux file systems
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 2 [19 Posts]   Goto page: 1, 2 Next
Author Message
DrDeaf

Joined: 30 Dec 2006
Posts: 50

PostPosted: Fri 26 Apr 2013, 21:27    Post subject:  Extended Attributes (OS/2 Style) in Linux file systems  

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
Back to top
View user's profile Send private message 
musher0


Joined: 04 Jan 2009
Posts: 4230
Location: Gatineau (Qc), Canada

PostPosted: Tue 07 May 2013, 12:14    Post subject:  

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

Changelog
This newer script checks for directories -- and will not allow comments for directories. (shucks Smile ) 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". Smile
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:
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.]
lsnote.jpg
 Description   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.
 Filesize   13.55 KB
 Viewed   275 Time(s)

lsnote.jpg


_________________
"Logical entities must not be multiplied needlessly." / "Il ne faut pas multiplier les êtres logiques inutilement." (Ockham)

Last edited by musher0 on Thu 09 May 2013, 10:30; edited 2 times in total
Back to top
View user's profile Send private message Visit poster's website 
DrDeaf

Joined: 30 Dec 2006
Posts: 50

PostPosted: Tue 07 May 2013, 13:04    Post subject:  

Thank you very much Musher0! Very Happy

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!
Back to top
View user's profile Send private message 
don570


Joined: 10 Mar 2010
Posts: 3254
Location: Ontario

PostPosted: Tue 07 May 2013, 13:32    Post subject: Keepnote  

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.

____________________________________________________
Back to top
View user's profile Send private message 
musher0


Joined: 04 Jan 2009
Posts: 4230
Location: Gatineau (Qc), Canada

PostPosted: Tue 07 May 2013, 14:46    Post subject:  

DrDeaf wrote:
Thank you very much Musher0! Very Happy

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?! Smile

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:
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

_________________
"Logical entities must not be multiplied needlessly." / "Il ne faut pas multiplier les êtres logiques inutilement." (Ockham)
Back to top
View user's profile Send private message Visit poster's website 
jamesbond

Joined: 26 Feb 2007
Posts: 2110
Location: The Blue Marble

PostPosted: Tue 07 May 2013, 14:56    Post subject: Re: Extended Attributes (OS/2 Style) in Linux file systems  

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.
attr-2.4.46-8.pet
Description  Download, open rox folder and click to install. Do not install directly from browser.
pet

 Download 
Filename  attr-2.4.46-8.pet 
Filesize  19.91 KB 
Downloaded  43 Time(s) 

_________________
Fatdog64, Slacko and Puppeee user. Puppy user since 2.13.
Contributed Fatdog64 packages thread
Back to top
View user's profile Send private message 
musher0


Joined: 04 Jan 2009
Posts: 4230
Location: Gatineau (Qc), Canada

PostPosted: Tue 07 May 2013, 17:36    Post subject:  

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

_________________
"Logical entities must not be multiplied needlessly." / "Il ne faut pas multiplier les êtres logiques inutilement." (Ockham)

Last edited by musher0 on Thu 09 May 2013, 10:28; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website 
DrDeaf

Joined: 30 Dec 2006
Posts: 50

PostPosted: Tue 07 May 2013, 21:26    Post subject:  

Thanks again, Musher0. Very Happy
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!
Back to top
View user's profile Send private message 
DrDeaf

Joined: 30 Dec 2006
Posts: 50

PostPosted: Tue 07 May 2013, 22:11    Post subject: Re: Extended Attributes (OS/2 Style) in Linux file systems  

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, Very Happy
Edit1: Ooops! Didn't have my view set wide enough and missed the link to it. Thanks! Embarassed
Edit2: Yep, so far so good. Thanks for the tools! JFS & XFS still "greyed out" for GParted....

Last edited by DrDeaf on Tue 07 May 2013, 23:30; edited 2 times in total
Back to top
View user's profile Send private message 
DrDeaf

Joined: 30 Dec 2006
Posts: 50

PostPosted: Tue 07 May 2013, 23:00    Post subject: Re: Keepnote  

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! Very Happy
Back to top
View user's profile Send private message 
disciple

Joined: 20 May 2006
Posts: 6427
Location: Auckland, New Zealand

PostPosted: Wed 08 May 2013, 09:18    Post subject: Re: Extended Attributes (OS/2 Style) in Linux file systems  

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

_________________
DEATH TO SPREADSHEETS
- - -
Classic Puppy quotes
- - -
Beware the demented serfers!
Back to top
View user's profile Send private message 
Karl Godt


Joined: 20 Jun 2010
Posts: 3964
Location: Kiel,Germany

PostPosted: Wed 08 May 2013, 10:07    Post subject:  

Quote:
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 .
Back to top
View user's profile Send private message Visit poster's website 
musher0


Joined: 04 Jan 2009
Posts: 4230
Location: Gatineau (Qc), Canada

PostPosted: Wed 08 May 2013, 10:34    Post subject:  

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.
lsnote-0.3b.pet
Description  Handy File & Folder Commentator, with localization capacity.
pet

 Download 
Filename  lsnote-0.3b.pet 
Filesize  1.84 KB 
Downloaded  55 Time(s) 

_________________
"Logical entities must not be multiplied needlessly." / "Il ne faut pas multiplier les êtres logiques inutilement." (Ockham)
Back to top
View user's profile Send private message Visit poster's website 
jamesbond

Joined: 26 Feb 2007
Posts: 2110
Location: The Blue Marble

PostPosted: Thu 09 May 2013, 07:38    Post subject: Re: Extended Attributes (OS/2 Style) in Linux file systems  

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 !

Quote:
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/faqs/filesystem.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 "/".

Quote:
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 Laughing

Quote:
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 Evil )

cheers!

_________________
Fatdog64, Slacko and Puppeee user. Puppy user since 2.13.
Contributed Fatdog64 packages thread
Back to top
View user's profile Send private message 
DrDeaf

Joined: 30 Dec 2006
Posts: 50

PostPosted: Fri 10 May 2013, 21:20    Post subject:  

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 Very Happy
(hmm, I wonder why the counter didn't tick up when I downloaded?)
Cheers!
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 2 [19 Posts]   Goto page: 1, 2 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » Beginners Help ( Start Here)
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1209s ][ Queries: 13 (0.0051s) ][ GZIP on ]