[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

RE: proposal to add apr_check_dir_empty() to APR

From: Ryan Bloom <rbb_at_covalent.net>
Date: 2002-07-02 22:22:07 CEST

> From: Karl Fogel [mailto:kfogel@newton.ch.collab.net]
>
> "Ryan Bloom" <rbb@covalent.net> writes:
> > This isn't portable. POSIX specifically states that you don't need
to
> > return "." or "..", and APR doesn't make any comments about them.
>
> Actually, APR does promise that "." and ".." will be returned, and
> will be returned first, on all platforms.
>
> See apr/include/apr_file_info.h:
>
> /**
> * Read the next entry from the specified directory.
> * @param finfo the file info structure and filled in by
apr_dir_read
> * @param wanted The desired apr_finfo_t fields, as a bit flag of \
> APR_FINFO_ values
> * @param thedir the directory descriptor returned from
apr_dir_open
> * @remark All systems return . and .. as the first two files.
> */
> APR_DECLARE(apr_status_t) apr_dir_read(apr_finfo_t *finfo,

The docs may say that, but the code doesn't do anything about "." and
"..". I just double-checked unix/dir.c. :-( I actually remember
looking at this years ago when I wrote the original code, and thinking
through the "." and ".." problem, which is why I said that APR will
return those two values first, but I don't think I ever actually coded
it, and I'm not sure how it would be done.

Ryan

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Jul 2 22:22:43 2002

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.