I read one other post here that I can download a file from the Perforce depot into a local disk without a client workspace. To extend that further, I need to download all files (text & binary) from a depot dir into my local disk. Is this the correct p4 command to do that?
p4 print //depot/dir1/...
I have a few questions:
- Will it download all sub directories as well as files from //depot/dir1/... or files only?
- Will it keep the original names of the files that will be downloaded?
- Where are the files located on the local disk given no local path is specified?
I'm using the p4api.net library. Will this code do it?
public void GetFiles(string DepotFilePath)
{
P4Command cmd = new P4Command( _repository, "print", true,
String.Format( "{0}/...", DepotFilePath ));
results = cmd.Run();
if (results.Success)
{
//do something here
}
}
I'm not sure where in the local disk it will dump the files into?
Thank you for your help in advance.
Latest Perforce already supports it natively:
https://www.perforce.com/manuals/cmdref/Content/CmdRef/p4_print.html#p4_print