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

Re: svn_client_ls - how can I tell file from dir

From: Ben Reser <ben_at_reser.org>
Date: 2004-03-25 02:30:44 CET

On Wed, Mar 24, 2004 at 08:14:58PM -0500, Garrett Rooney wrote:
> No, you have to use libsvn_ra to test if the target is a file or
> directory, you can't derive the info from svn_client_ls. See the
> check_path function in the svn_ra_plugin_t data structure.

No? What I gave works with the one exception that I mentioned. Which
is if a directory contains a single file of the same name as the
directory then you cannot infer the node type of the target of
svn_client_ls.

The ra lib option works. But it is very ugly. In his particular case
he might as well reimplement svn_client_ls practically if he did that.

I suppose we should deprecate svn_client_ls and replace it with a
function that returns relative paths to the target. I.E. if you ask for
foo and foo is a file you'd get a key named foo. If you ask for foo and
foo is a directory containing a file named foo you'd get foo/foo.

Apps that wanted just the basename could use svn_path_basename.

ISTR that there were other things we wanted to fix in svn_client_ls.
Maybe we want to make it take more than one target? I also recall
someone complaining that the name was too "unix" for the API. So when
we fix these we could rename it to svn_client_dir or svn_client_list or
whatever else we desired.

-- 
Ben Reser <ben@reser.org>
http://ben.reser.org
"Conscience is the inner voice which warns us somebody may be looking."
- H.L. Mencken
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Mar 25 02:30:59 2004

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.