Click or drag to resize

RepositoryGetDepotDirs Method (IListString, Options)

List selected directory paths in the repository.

Namespace:  Perforce.P4
Assembly:  p4api.net (in p4api.net.dll) Version: 2023.2.258.5793
Syntax
public IList<string> GetDepotDirs(
	IList<string> dirs,
	Options options
)

Parameters

dirs
Type: System.Collections.GenericIListString
options
Type: Perforce.P4Options

Return Value

Type: IListString
Remarks

p4 help dirs

dirs -- List depot subdirectories

p4 dirs [-C -D -H] [-S stream] dir[revRange] ...

List directories that match the specified file pattern (dir).
This command does not support the recursive wildcard (...).
Use the * wildcard instead.

Perforce does not track directories individually. A path is treated
as a directory if there are any undeleted files with that path as a
prefix.

By default, all directories containing files are listed. If the dir
argument includes a revision range, only directories containing files
in the range are listed. For details about specifying file revisions,
see 'p4 help revisions'.

The -C flag lists only directories that fall within the current
client view.

The -D flag includes directories containing only deleted files.

The -H flag lists directories containing files synced to the current
client workspace.

The -S flag limits output to depot directories mapped in a stream's
client view.

Examples
To get dirs on the server that fall within the current client view:
   GetDepotDirsCmdOptions opts =
   new GetDepotDirsCmdOptions(GetDepotDirsCmdFlags.CurrentClientOnly, null);

IList<String> dirs = new List<String>()
dirs.Add("//*");

   IList<String> target = Repository.GetDepotDirs(dirs, opts);
To get dirs on the server that contain files synced to the current client workspace:
   GetDepotDirsCmdOptions opts =
   new GetDepotDirsCmdOptions(GetDepotDirsCmdFlags.SyncedDirs, null);

IList<String> dirs = new List<String>()
dirs.Add("//*");

   IList<String> target = Repository.GetDepotDirs(dirs, opts);
To get dirs on the server that fall under the path //depot/main/:
   GetDepotDirsCmdOptions opts =
   new GetDepotDirsCmdOptions(GetDepotDirsCmdFlags.None, null);

IList<String> dirs = new List<String>()
dirs.Add("//depot/main/*");

   IList<String> target = Repository.GetDepotDirs(dirs, opts);
See Also