LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-24-2006, 05:24 AM   #1
vishalbutte
Member
 
Registered: Dec 2005
Posts: 80

Rep: Reputation: 15
Question adding flag in inode structure


Hi all,
I want to associate one flag ( similar to file permissions ) with all files created on linux. So that i can see that flag whenvever i use " ls -l " command. So is that possible add such flag in inode structure ? Or it needs much more changes in kernel code?

Thankx.
 
Old 01-25-2006, 09:48 AM   #2
crabboy
Senior Member
 
Registered: Feb 2001
Location: Atlanta, GA
Distribution: Slackware
Posts: 1,823

Rep: Reputation: 121Reputation: 121
Not an easy task. What's this attribute for?

You'll have to modify the inode and the kernel to poulate the new field. ls will have to be modifed to display the field as well.

These changes will have to be merged back into any updated kernel that you ever download.

Doesn't sound like it's worth the effort.
 
Old 01-25-2006, 09:59 AM   #3
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Ubuntu/WSL
Posts: 9,777

Rep: Reputation: 470Reputation: 470Reputation: 470Reputation: 470Reputation: 470
It looks to me that most of the OP request is already implemented through the Extended Attributes (man attr) and/or ACLs.
The only missing part is being able to display the attribute with ls, as it is normally done with getfattr.
 
Old 01-25-2006, 10:20 AM   #4
crabboy
Senior Member
 
Registered: Feb 2001
Location: Atlanta, GA
Distribution: Slackware
Posts: 1,823

Rep: Reputation: 121Reputation: 121
Ahh, looks like my Linux is getting crusty in my old age.

http://wiki.linuxquestions.org/wiki/Extended_attributes
 
Old 01-25-2006, 12:38 PM   #5
vishalbutte
Member
 
Registered: Dec 2005
Posts: 80

Original Poster
Rep: Reputation: 15
Thanks for all the replies.
Well i ( root ) am going to keep the the hash of the files in the database. After adding hash root will set the flag for the corresponding file. So when root will use " ls -l " command , flag will indicate the files of which hash is added in the databases.

I am going through that extended attributes. Can that attributes will serve my above purpose ? Or i indeed will need to add extra flag in inode structure.

Once again thanks to all !!!
 
Old 01-25-2006, 12:46 PM   #6
crabboy
Senior Member
 
Registered: Feb 2001
Location: Atlanta, GA
Distribution: Slackware
Posts: 1,823

Rep: Reputation: 121Reputation: 121
It would seem to me that you could; however, you would not be using ls -l to view the attribute, you would use getfattr.
 
Old 01-25-2006, 01:24 PM   #7
vishalbutte
Member
 
Registered: Dec 2005
Posts: 80

Original Poster
Rep: Reputation: 15
Thank you crabboy.
If that is possible by using extended attributes then its really good news for me.

Thankx to all.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Unattached Inode? Killean Slackware 8 05-17-2006 04:38 PM
Information needed about the use of the reserved field in the inode structure calsoft_pg Linux - Software 1 12-23-2005 10:27 PM
inode errors millionknives Linux - General 2 08-08-2004 12:02 PM
inode muthiahm Linux - Newbie 2 06-11-2004 04:00 PM
about inode eshwar_ind Programming 3 04-24-2004 02:39 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:07 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration