[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:31:26 CEST

> From: Aaron Bannert [mailto:aaron@clove.org]
>
> On Tue, Jul 02, 2002 at 01:07:59PM -0700, Ryan Bloom wrote:
> > The return code should not be EGENERAL if the directory isn't empty.
> > Create a new status code if you have to, but a non-empty directory
is
> > not an error condition.
>
> I agree. EGENERAL is not the polar opposite of SUCCESS. APR isn't
> really friendly with simple binary functions that want to return
errors.
> It seems like you just want to return true or false in the normal
case,
> but also have the option to return an error if something blows up.
> Adding another apr_status_t code would be ok. Maybe APR_FAILURE to
> complement APR_SUCCESS, or we could go all out and add APR_TRUE
> and APR_FALSE...

No. APR is incredibly friendly with simple binary functions that want
to return errors. Take a look at apr_errno.h, we have a whole section
of return codes that do not imply success or failure, they are STATUS
codes. In this case, add a new STATUS code for non-empty directory, and
then you can return APR_SUCCESS for empty, the new code for non-empty,
and an error value for an error.

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:31:54 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.