Re: [gtk-list] General C question - file attributes

On Sun, Aug 15, 1999 at 09:25:55AM -0400, John C Atkeson wrote:
>   I'm reading directories with opendir, readdir and closedir.   Um... how
I was looking for these... glad I read your question.
> do I detect file attributes, specifically how to distinguish files from
> sub-directories? 
In the man page for readdir I found this:
              struct dirent {
                      long            d_ino;  /* inode number */
                      off_t           d_off;  /* offset to the next dirent */
                      unsigned short  d_reclen;/* length of this record */
                      unsigned char   d_type;         /* type of file */
                      char            d_name[256];    /* filename */
That is what is returned from readdir, this is just a guess but I would think
that d_type is what you are looking for.


Travis Loyd <>
[Replace PGP with GPG today! [*] Support .RFC 2015. ]

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]