Click or drag to resize

ClientDeleteFiles Method (Options, FileSpec)

Delete Files

Namespace:  Perforce.P4
Assembly:  p4api.net (in p4api.net.dll) Version: 2023.2.258.5793
Syntax
public IList<FileSpec> DeleteFiles(
	Options options,
	params FileSpec[] files
)

Parameters

options
Type: Perforce.P4Options
Options to the delete command
files
Type: Perforce.P4FileSpec
Files to delete

Return Value

Type: IListFileSpec
A list of FileSpecs for the deleted comand
Remarks

p4 help delete

delete -- Open an existing file for deletion from the depot

p4 delete [-c changelist#] [-n -v -k] file ...

Opens a depot file for deletion.
If the file is synced in the client workspace, it is removed. If a
pending changelist number is specified using with the -c flag, the
file is opened for delete in that changelist. Otherwise, it is opened
in the default pending changelist.

Files that are deleted generally do not appear on the have list.

The -n flag displays a preview of the operation without changing any
files or metadata.

The -k flag performs the delete on the server without modifying
client files. Use with caution, as an incorrect delete can cause
discrepancies between the state of the client and the corresponding
server metadata.

The -v flag enables you to delete files that are not synced to the
client workspace. The files should be specified using depot syntax;
since the files are not synced, client syntax or local syntax are
inappropriate and could introduce ambiguities in the file list.
Note, though, that if the files ARE synced, 'delete -v' will remove
the files from the client in addition to opening them for delete.
The preferred way to delete a set of files without transferring
them to your machine is: 'sync -k file...', then 'delete -k file...'

'p4 delete' is not supported for files with propagating attributes
from an edge server in a distributed environment.

See Also