You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by "William A. Rowe, Jr." <wr...@rowe-clan.net> on 2001/08/07 16:33:27 UTC

Re: cvs commit: apr/file_io/win32 dir.c

From: <tr...@apache.org>
Sent: Tuesday, August 07, 2001 9:12 AM


> trawick     01/08/07 07:12:29
> 
>   Modified:    file_io/win32 dir.c
>   Log:
>   mention some problems with apr_dir_rewind() for Win32
>   
>   Revision  Changes    Path
>   1.58      +6 -0      apr/file_io/win32/dir.c
>   
>   Index: dir.c
>   ===================================================================
>   RCS file: /home/cvs/apr/file_io/win32/dir.c,v
>   retrieving revision 1.57
>   retrieving revision 1.58
>   diff -u -r1.57 -r1.58
>   --- dir.c 2001/08/06 21:04:50 1.57
>   +++ dir.c 2001/08/07 14:12:29 1.58
>   @@ -257,6 +257,12 @@
>    
>    APR_DECLARE(apr_status_t) apr_dir_rewind(apr_dir_t *dir)
>    {
>   +    /* XXX FIXME...
>   +     * 1) dir_cleanup() does FindClose(), so the FindClose() call
>   +     *    here will always return a meaningless error (bad handle).

Outch

>   +     * 2) Don't we need to re-open the directory, or is there a
>   +     *    Win32 way to rewind?

No.  By closing (and marking the handle as closed) the next apr_dir_read
will reopen the directory walk.  There is no such thing as an 'open dir'
on win32, you are either reading the first, or the next entry.

Bill


Re: cvs commit: apr/file_io/win32 dir.c

Posted by Jeff Trawick <tr...@attglobal.net>.
"William A. Rowe, Jr." <wr...@rowe-clan.net> writes:

> >   --- dir.c 2001/08/06 21:04:50 1.57
> >   +++ dir.c 2001/08/07 14:12:29 1.58
> >   @@ -257,6 +257,12 @@
> >    
> >    APR_DECLARE(apr_status_t) apr_dir_rewind(apr_dir_t *dir)
> >    {
> >   +    /* XXX FIXME...
> >   +     * 1) dir_cleanup() does FindClose(), so the FindClose() call
> >   +     *    here will always return a meaningless error (bad handle).
> 
> Outch
> 
> >   +     * 2) Don't we need to re-open the directory, or is there a
> >   +     *    Win32 way to rewind?
> 
> No.  By closing (and marking the handle as closed) the next apr_dir_read
> will reopen the directory walk.  There is no such thing as an 'open dir'
> on win32, you are either reading the first, or the next entry.

thanks for the info...  that certainly makes the fix easy :)

-- 
Jeff Trawick | trawick@attglobal.net | PGP public key at web site:
       http://www.geocities.com/SiliconValley/Park/9289/
             Born in Roswell... married an alien...