James wrote:
> how do i use the S_IS* macros? i want to check files to see if they really
> are files or directories... all it says is
>
> S_ISREG(m) regular file?
>
> what's m?
The st_mode field of a `struct stat'.
> i've tried stating a filename, then doing:
>
> if (S_ISREG(buf.st_rdev)) /* st_rdev seemed the most sensible */
Why? I guess you were reading the `device type (if inode device)'
comment. st_rdev contains the major/minor numbers for devices; it
doesn't apply to any other inode type.
It should be
if (S_ISREG(buf.st_mode))
--
Glynn Clements <[EMAIL PROTECTED]>