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

Re: Fwd: [Issue 2399] svn_ra_stat returning error for non-existent path instead of NULL dirent_t*

From: Peter N. Lundblad <peter_at_famlundblad.se>
Date: 2005-09-13 09:11:25 CEST

On Mon, 12 Sep 2005, William Ferguson wrote:

> --- Ben Collins-Sussman <sussman@collab.net> wrote:
>
> > Logically, if you try to open an existing file as
> > if it were a directory, you are ignoring critical
> > filesystem information --
> > namely, the type of the node. This is an error on
> > the part of application using the filesystem.
> > Yes, the path doesn't exist, but
> > errors trump this fact. The application is 100%
> > capable of finding out the type of the existing node
> > before trying to incorrectly open
> > it as a directory. Just run svn_ra_get_dir() on
> > its parent.
>
> Sure, but this implies that while using the svn_ra
> library, every call to svn_ra_stat must be preceded by
> one call to svn_ra_dir for each segment of the path
> that is to be supplied to svn_ra_stat. So instead of
> making a single call to svn_ra_stat to determine
> whether a node is legit, we currently need to make n
> class to svn_ra_dir + 1 to svn_ra_stat or risk having
> svn_ra_stat fail because some part of the path
> supplied by the client may refer to a file when they
> believed it to be a folder.
>
An alternative that springs to my mind is to just catch this error in your
application and handle it.

Regards,
//Peter

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Sep 13 09:12:31 2005

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