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

P4 Virtual File Service Documentation | 2025.2

# chmod

## Purpose

Instruct the P4ALTSYNC agent to change the permissions on a placeholder or hydrated file.

## Input to agent

Key | Value
--- | ---
altSync | `chmod`
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
clientFile | The client syntax path of the file
depotFile | The depot syntax path of the file
rev | The revision number of the file
writable | `true` for writable, or `false` for read-only
executable | `true` for executable, or `false` for not executable

The command might or might not include additional keys.

## Action for the agent to perform

Change the file’s attributes to make it either writable or read-only.

If the P4API default behavior meets your needs (calling `chmod` against the file system), the P4ALTSYNC agent can instruct the client to pass-through to the P4API’s chmod logic by returning `"result":"pass"`

## Output from the agent

Key | Value
--- | ---
result | Boolean true for success, or the string `"pass"` to pass-through to the P4API’s chmod logic
error | Description of what went wrong (only applicable if result is non-zero)
chmod | `pass` if the P4ALTSYNC agent is requesting the P4API handle the chmod. Not necessary if `result=pass`

## Example of input and output

Input:

Copy

    {"altSync":"chmod","client":"vfs-cmr5","clientFile":"//vfs-cmr5/test+k.txt","depotFile":"//depot/test+k.txt","path":"e:\\temp\\vfs\\cmr5\\test+k.txt","port":"perforce:1666","rev":2,"user":"npoole","writable":true,"executable":false}

Output:

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

Your search for returned results