[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: Garrett Rooney <rooneg_at_electricjellyfish.net>
Date: 2004-03-25 02:14:58 CET

On Mar 24, 2004, at 8:12 PM, Ben Reser wrote:

> On Wed, Mar 24, 2004 at 04:58:23PM -0800, Ben Reser wrote:
>> If you get one entry in the hash the entry could be a reply to a file
>> or
>> a directory target. You'll need to look at the svn_dirent_t listing
>> for
>> the kind entry for the single hash entry. That'll give you your
>> answer
>> there.
>
> Correction, you have to look at the keyname to see if it matches the
> target you requested in this case. A reply to a directory with one
> entry or a file could both potentially return a single file.
>
> However, even then you can still run into a ambiguity issue. If you
> have a dir named foo with a file named foo in it, is the foo you asked
> for a dir or a file? I don't think there's a way to find out.

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.

-garrett

---------------------------------------------------------------------
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:15:14 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.