Helix Core is now P4. Product user interfaces will be updated soon. Learn more >>

P4 Virtual File Service Documentation | 2025.2

# 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 | `true` to delete if any directories left empty by the file move. The client’s root is excluded from removal.

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 | An description of what went wrong (only applicable if result is non-zero)
move | `pass` if the P4ALTSYNC agent is requesting the P4API handle the move. Not necessary if `result=pass`

## Example of input and output

Input:

Copy

    {"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"}

Output:

    {"result":true,"move":"pass"}

Your search for returned results