apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Stein <gst...@lyra.org>
Subject Re: New directory API...
Date Mon, 22 Jan 2001 10:25:13 GMT
On Sun, Jan 21, 2001 at 10:45:56PM -0800, rbb@covalent.net wrote:
>...
> > Two choices.  apr_dir_fileinfo() which deals with it and merges them.
> > Or preallocate a buffer in the opendir of the fname length (dir name) plus
> > the length of the longest allowed filename, up to the limit of the total
> > path length.  No sense returning a name >_MAX_PATH, I already have this
> > exception in Win32 (and just skip over such bogus files.)
> > 
> > I'll have the Win32 implementation tommorow about noon for all to consider.
> > I'd like to see this be done so the api continues to reflect reality.  I'm
> > going to sleep - need rest.
> 
> preallocating a buffer won't work, because we end up with thread-safety
> issues.  Not a problem for Apache, but for other
> programs... boom!  :-)  Let me sleep on this tonight.

I'm simply advocating to let the caller optimize the thing.

But I did want to point out that thread-safety probably isn't an issue.
AFAIK, we don't let two threads deal with the same apr_file_t or apr_dir_t.

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/

Mime
View raw message