apr file questions

2002-04-17 Thread Stas Bekman
I've two questions regarding coding with apr_file_ family 1. Is it a good idea to apr_file_mktemp with APR_BUFFERED flag on? The current default is off. 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:

Re: apr file questions

2002-04-18 Thread Jeff Trawick
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); > ... >

Re: apr file questions

2002-04-18 Thread Stas Bekman
Jeff Trawick wrote: 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); .

Re: apr file questions

2002-04-18 Thread Cliff Woolley
On 18 Apr 2002, Jeff Trawick wrote: Since APR_EOF is one of the errors you might get back from apr_file_read(), I agree with Jeff. This: > > while (apr_file_read(file, buffer, &len) != APR_SUCCESS) > > { > > ... > > } is probably preferable. You'll most l

Re: apr file questions

2002-04-18 Thread Jeff Trawick
Stas Bekman <[EMAIL PROTECTED]> writes: > Jeff Trawick wrote: > > 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

Re: apr file questions

2002-04-18 Thread Jon Travis
On Thu, Apr 18, 2002 at 10:40:12AM -0400, Cliff Woolley wrote: > On 18 Apr 2002, Jeff Trawick wrote: > > Since APR_EOF is one of the errors you might get back from > apr_file_read(), I agree with Jeff. This: > > > > while (apr_file_read(file, buffer, &len) != APR_SUCCESS) > > >

Re: apr file questions

2002-04-18 Thread Stas Bekman
Cliff Woolley wrote: On 18 Apr 2002, Jeff Trawick wrote: Since APR_EOF is one of the errors you might get back from apr_file_read(), I agree with Jeff. This: while (apr_file_read(file, buffer, &len) != APR_SUCCESS) { ... } is probably preferable. You'll most l