I'm having some difficulty understanding the meaning behind all this parameters in the dirent structure.
struct dirent{
ino_t d_ino; Inode number
off_t d_off; Not an offset; see below
unsigned short d_reclen; Length of this record
unsigned chart d_type; Type of file;
not supported by all filesystem types
char d_name[256]; Null-Terminated filename
}
I really need to understand this because I have to work on some files. Correct if I'm wrong, this struct is returned when you use opendir on a DIR* object right? This object is non-other than metadata of the file inside the directory, and every time I use it will return me the metadata of the next file, right?
The parameters that I don't understand are: d_off -> not an offset? What is it then? See below where? I checked the original page with all the info and I couldn't find where was I supposed to look. d_type -> what do they mean with "not supported by all filesystem types"? Which filesystem should I look out for? Okay, with this information how can I open the file on which I have to modify the data? Do I just use the d_name, or is there something way more comfortable I can rely on? Those are all my doubts, thank you in advance.