Mail Archives: djgpp-workers/1998/05/27/14:46:33
> >readdir DOESN'T SET errno TO 0, if it returns 0 and the
> >directory is at its end !!!!!!!!!!!!!!
Sounds typical.
> Can somebody check what POSIX has to say about this?
OK (hand transcribed) -
ISO/IEC 9945-1 : 1990
IEEE Std 1003.1 - 1990
5.1.2.3 Returns
<...>
Upons successful completioon, readdir() returns a pointer to an object
of type struct dirent. When an error is encountered, a value of NULL is
returned and errno is set to indicate the error. When the end of the
directory is encountered, a value of
NULL is returned and errno is unchanged bu this function call.
> Thus, you can get the desired behavior by setting `errno=0'
> yourself beforehand. Is that what one's supposed to do?
Seems like that would be the way to do it.
Andy
--
_______ ___________________________________________________________
/ Andrew Crabtree
/ Workgroup Networks Division
____ ___ / Hewlett-Packard
/ / / / Roseville, CA
__/ __/ _____/ 916/785-1675
/ andrewc AT rosemail DOT rose DOT hp DOT com
___________ __/ _____________________________________________________
- Raw text -