www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/05/26/16:13:09

From: erikyyy AT studbox DOT uni-stuttgart DOT de
Message-ID: <19980526221202.B1173@vulcain.yyydom>
Date: Tue, 26 May 1998 22:12:02 +0200
To: djgpp AT delorie DOT com
Subject: BUG in readdir libc function
Mime-Version: 1.0

my linux libc docu sais, that readdir returns 0 on error
and may set errno to

`EBADF'           The DIRSTREAM argument is not valid. 

since 0 may also mean, that the directory is at the end, there must
be a way to distinguish between those two cases.

i think the right way to do this is

if (!readdir(.......)) if (errno) die("system shit");
	else printf("directory ends");

this doesn't work, because:


readdir DOESN'T SET errno TO 0, if it returns 0 and the
directory is at its end !!!!!!!!!!!!!!

byebye
Erik

PS: please reply me, too. (ML too much traffic)

--
EMAIL: erikyyy AT studbox DOT uni-stuttgart DOT de                  \\\\
       thieleek AT tick DOT informatik DOT uni-stuttgart DOT de         o `QQ'_
IRC:   erikyyy                                            /   __8
WWW:   http://wwwcip.rus.uni-stuttgart.de/~inf24628/      '  `
       http://tick.informatik.uni-stuttgart.de/~thieleek/

--WAC01150.896213263/vulcain.yyydom--

----- End forwarded message -----
--
EMAIL: erikyyy AT studbox DOT uni-stuttgart DOT de                  \\\\
       thieleek AT tick DOT informatik DOT uni-stuttgart DOT de         o `QQ'_
IRC:   erikyyy                                            /   __8
WWW:   http://wwwcip.rus.uni-stuttgart.de/~inf24628/      '  `
       http://tick.informatik.uni-stuttgart.de/~thieleek/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019