Searching for files (Client API)

If you are having a problem using Vault, post a message here.
Post Reply
PeterAslund
Posts: 5
Joined: Mon Aug 31, 2015 5:53 am

Searching for files (Client API)

Post by PeterAslund » Mon Aug 31, 2015 7:27 am

Hi!

I want do make a search and download all files with ".csproj" inside a folder.
I have tried achieving this via the Client API command prompt application.

When running this command:
vault.exe findinfolder "*.csproj" "RootFolder/SubFolder" -host "{HOST}" -username "{USERNAME}" -password "{PASSWORD}" -repository "{REPO}"
I get the error: "No object was found at the repository part: RootFolder/SubFolder


I have also tried with specifying the path with $ as:
vault.exe findinfolder "*.csproj" "$/RootFolder/SubFolder" -host "{HOST}" -username "{USERNAME}" -password "{PASSWORD}" -repository "{REPO}"
This gave me this error: The repository's index is not currently enabled.

Is this something I have to enable?

Please note that I necessarily want to search the file contents, only the filename. Is there a better way?

// Peter Åslund

Beth
Posts: 8550
Joined: Wed Jun 21, 2006 8:24 pm
Location: SourceGear
Contact:

Re: Searching for files (Client API)

Post by Beth » Mon Aug 31, 2015 8:43 am

You can try the GetWildCard command for that. Here's the info on that command: http://download.sourcegear.com/Vault/8. ... ETWILDCARD.
Beth Kieler
SourceGear Technical Support

PeterAslund
Posts: 5
Joined: Mon Aug 31, 2015 5:53 am

Re: Searching for files (Client API)

Post by PeterAslund » Tue Sep 01, 2015 2:12 am

Thank you! The GetWildCard command was exactly what I needed.

Can I suggest the feature that you can specify multiple wildcards. For example specifying multiple file extensions as:
".csproj;.sln"

And also showing how many files that where copied, in the xml result.


Thank you for the help

Beth
Posts: 8550
Joined: Wed Jun 21, 2006 8:24 pm
Location: SourceGear
Contact:

Re: Searching for files (Client API)

Post by Beth » Tue Sep 01, 2015 10:13 am

I've logged your requests. Thank you for your feedback.

F: 18161, 18162
Beth Kieler
SourceGear Technical Support

Beth
Posts: 8550
Joined: Wed Jun 21, 2006 8:24 pm
Location: SourceGear
Contact:

Re: Searching for files (Client API)

Post by Beth » Tue Sep 01, 2015 12:57 pm

Scratch one of those. I think you can currently get by multiple wild cards. Separate each by a space and see if that gets you the results you need.

For example,

Code: Select all

vault.exe -user xxx -password yyy -repository zzz GETWILDCARD $/some/path/ *.csproj *.sln *.h
Same thing can be done with the regular GET. There is a character limit that Windows sets, so will have to watch the number of items entered.
Beth Kieler
SourceGear Technical Support

Post Reply