Click or drag to resize

RepositoryGetDepotFiles Method

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

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

Parameters

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

Return Value

Type: IListFileSpec
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 a maximum of 10 files from the repository:
GetDepotFilesCmdOptions opts =
new GetDepotFilesCmdOptions(GetDepotFilesCmdFlags.None, 10);
FileSpec fs = new FileSpec(new DepotPath("//depot/..."), null);
List<FileSpec> lfs = new List<FileSpec>();
lfs.Add(fs);
IList<FileSpec> files = Repository.GetDepotFiles(lfs, opts);
See Also