Stas Bekman <[EMAIL PROTECTED]> writes:
> 2. What's the idiomatic apr read till eof? From grepping the source
> code, I see apr_file_eof is hardly ever used. Is something wrong with:
>
> while (!apr_file_eof(fp)) {
> rc = apr_file_read(fp, buf, &nbytes);
> ...
> }
>
> I saw code like this:
>
> while (apr_file_read(file, buffer, &len) != APR_SUCCESS)
> {
> ...
> }
>
> which one is better to use?
I would suggest the second one. What if you hit an I/O error? I
always did
while (!feof() && !ferror())
with stdio.
--
Jeff Trawick | [EMAIL PROTECTED]
Born in Roswell... married an alien...