Click or drag to resize

ClientEditFiles Method (Options, FileSpec)

Edit Files

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

Parameters

options
Type: Perforce.P4Options
Options to Edit command
files
Type: Perforce.P4FileSpec
Array of Files to Edit

Return Value

Type: IListFileSpec
List of edited files
Remarks

p4 help edit

edit -- Open an existing file for edit

p4 edit [-c changelist#] [-k -n] [-t filetype] file ...

Open an existing file for edit. The server records the fact that
the current user has opened the file in the current workspace, and
changes the file permission from read-only to read/write.

If -c changelist# is included, the file opened in the specified
pending changelist. If changelist number is omitted, the file is
opened in the 'default' changelist.

If -t filetype is specified, the file is assigned that Perforce
filetype. Otherwise, the filetype of the previous revision is reused.
If a partial filetype is specified, it is combined with the current
filetype.For details, see 'p4 help filetypes'.
Using a filetype of 'auto' will cause the filetype to be chosen
as if the file were being added, that is the typemap will be
considered and the file contents may be examined.

The -n flag previews the operation without changing any files or
metadata.

The -k flag updates metadata without transferring files to the
workspace. This option can be used to tell the server that files in
a client workspace are already editable, even if they are not in the
client view. Typically this flag is used to correct the Perforce
server when it is wrong about the state of files in the client
workspace, but incorrect use of this option can result in inaccurate
file status information.

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

See Also