You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by vinay i <vi...@gmail.com> on 2008/10/17 15:25:05 UTC

How to find whether an subversion element is a directory or file

Hi All
Is there a way to find out whether an subversion element is a directory or
file? I don't have a working directory. I want to run a command on the
repository and find out if it is a file or directory? Is it possible to do
that?

Thanks
Vinay

Re: How to find whether an subversion element is a directory or file

Posted by vinay i <vi...@gmail.com>.
One method which I followed is run "svn info filename". Then i grep for Node
Kind: directory. Is there a neater way of doing it?

-Vinay

On Fri, Oct 17, 2008 at 8:55 PM, vinay i <vi...@gmail.com> wrote:

> Hi All
> Is there a way to find out whether an subversion element is a directory or
> file? I don't have a working directory. I want to run a command on the
> repository and find out if it is a file or directory? Is it possible to do
> that?
>
> Thanks
> Vinay
>

Re: How to find whether an subversion element is a directory or file

Posted by vinay i <vi...@gmail.com>.
Thanks David. 2nd option looks neater.

-Vinay

On Fri, Oct 17, 2008 at 10:59 PM, David Weintraub <qa...@gmail.com> wrote:

> As you already stated, you can do an svn info on that file, and then
> check the output. Using the --xml switch might make this a bit easier
> for scripts.
>
> Also, if you list a directory, and the file listed ends in a slash,
> the file is a directory.
>
> You can also try doing a "svn ls" on that file and see if the output
> is the file name or a listing.
>
> If you simply want a recursive "svn ls", use the -R switch. Most
> people don't realize that.
>
> --
> David Weintraub
> qazwart@gmail.com
>
>
>
> On Fri, Oct 17, 2008 at 11:25 AM, vinay i <vi...@gmail.com> wrote:
> > Hi All
> > Is there a way to find out whether an subversion element is a directory
> or
> > file? I don't have a working directory. I want to run a command on the
> > repository and find out if it is a file or directory? Is it possible to
> do
> > that?
> >
> > Thanks
> > Vinay
> >
>

Re: How to find whether an subversion element is a directory or file

Posted by David Weintraub <qa...@gmail.com>.
As you already stated, you can do an svn info on that file, and then
check the output. Using the --xml switch might make this a bit easier
for scripts.

Also, if you list a directory, and the file listed ends in a slash,
the file is a directory.

You can also try doing a "svn ls" on that file and see if the output
is the file name or a listing.

If you simply want a recursive "svn ls", use the -R switch. Most
people don't realize that.

--
David Weintraub
qazwart@gmail.com



On Fri, Oct 17, 2008 at 11:25 AM, vinay i <vi...@gmail.com> wrote:
> Hi All
> Is there a way to find out whether an subversion element is a directory or
> file? I don't have a working directory. I want to run a command on the
> repository and find out if it is a file or directory? Is it possible to do
> that?
>
> Thanks
> Vinay
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org