move
Purpose
Instruct the P4ALTSYNC agent to move a placeholder or hydrated file.
Input to agent
Key |
Value |
---|---|
altSync | move
|
client | The client workspace name |
port | The P4PORT the client used to connect to the server |
user | The P4USER the client used to connect to the server |
path | The local syntax path of the file to move |
path2 | The local syntax path of the file to move to |
rmdir |
|
The command might or might not include additional keys.
Action for the agent to perform
Move the file specified by path
to path2
.
If rmdir
is set, recursively delete any directories made empty by this operation. If this command causes the parent directory to be empty, repeat the process of deleting that empty directory and deleting its parent directory, if empty. (However, do not delete the client root, even if it is empty.)
If the P4API default behavior for move meets your needs (calling rename
against the file system, potentially falling back to copy/delete and/or using a temporary 3rd location in the case the file is moved to or from a directory that overlaps the new filename and then potentially calling rmdir
against any empty directories), the P4ALTSYNC agent can instruct the client to pass-through to the P4API’s move logic by returning "result":"pass"
Output from the agent
Key |
Value |
---|---|
result | Boolean true for success, or the string "pass" |
error | Description of what went wrong (applicable only if the result is boolean false or the string literal "error") |
Example of input and output
{"altSync":"move","client":"vfs-cmr5","path":"e:\\temp\\vfs\\cmr5\\test+k.txt","path2":"e:\\temp\\vfs\\cmr5\\test+k2.txt","port":"perforce:1666","rmdir":true,"user":"npoole"}
{"result":"pass"}