Click or drag to resize

RepositoryGetFiles Method (IListFileSpec, Options)

Return a list of Files in the depot that correspond to the passed-in FileSpecs.

Namespace:  Perforce.P4
Assembly:  p4api.net (in p4api.net.dll) Version: 2023.2.258.5793
Syntax
public IList<File> GetFiles(
	IList<FileSpec> filespecs,
	Options options
)

Parameters

filespecs
Type: System.Collections.GenericIListFileSpec
options
Type: Perforce.P4Options

Return Value

Type: IListFile
Remarks

p4 help files

files -- List files in the depot

p4 files [ -a ] [ -A ] [ -e ] [ -m max ] file[revRange] ...
p4 files -U unloadfile ...

List details about specified files: depot file name, revision,
file, type, change action and changelist number of the current
head revision. If client syntax is used to specify the file
argument, the client view mapping is used to determine the
corresponding depot files.

By default, the head revision is listed. If the file argument
specifies a revision, then all files at that revision are listed.
If the file argument specifies a revision range, the highest revision
in the range is used for each file. For details about specifying
revisions, see 'p4 help revisions'.

The -a flag displays all revisions within the specific range, rather
than just the highest revision in the range.

The -A flag displays files in archive depots.

The -e flag displays files with an action of anything other than
deleted, purged or archived. Typically this revision is always
available to sync or integrate from.

The -m flag limits files to the first 'max' number of files.

The -U option displays files in the unload depot (see 'p4 help unload'
for more information about the unload depot).

Examples
To get Files in local depot //depot/...:
FileSpec fs = new FileSpec(new DepotPath("//depot/..."), null);
IList<FileSpec> lfs = new List<FileSpec>();
lfs.Add(fs);

GetDepotFilesCmdOptions opts =
new GetDepotFilesCmdOptions(GetDepotFilesCmdFlags.None, 0);

IList<File> target = Repository.GetFiles(lfs, opts);
To get Files in unload depot //Unloaded/...:
FileSpec fs = new FileSpec(new DepotPath("//Unloaded/..."), null);
IList<FileSpec> lfs = new List<FileSpec>();
lfs.Add(fs);

GetDepotFilesCmdOptions opts =
new GetDepotFilesCmdOptions(GetDepotFilesCmdFlags.InUnloadDepot, 0);

IList<File> target = Repository.GetFiles(lfs, opts);
See Also