I’m editing linux v2.18.8 (CentOS5) to include file attributes for a project for school. One of the things we have to implement as a group is to list all attribute names (Attributes are text files stored in hidden directories at the same level as the file).
Just an example:
this.jpg is a file in /Desktop/Testing. When you add a custom user attribute a folder is created that holds the attributes. So if I add the attribute “Creator” and have it’s value as “bob” you get a dir /Desktop/Testing/.this.jpg_attr/Creator (and if you open Creator, it’s contents will be “bob”).
What I’m interested in doing is listing all of the user created attributes in the attributes folder (or from the example all the files in /Desktop/Testing/.this.jpg_attr/) I know that I want to use the readdir call, but I don’t know where to find it in the linux setup. If anyone could give me any guidance as to where to look for readdir, I think I can figure out how to manipulate it.
I’M NOT ASKING FOR ANY CODE. JUST A FILE PATH FOR WHERE READDIR IS, OR THE SYSTEM CALL THAT CALLS READDIR.
Thanks in advanced.
It’s not exactly clear what you mean. The
readdirfunction you want to use is part of the standard library and will be linked in automatically.Perhaps you’re asking how to include the header file that declares
readdir. In that case:You can get more information about the
readdirfunction using this command: