ubuntu_write_file
Write text content to a policy-allowed file path using atomic writes, with automatic backups of existing files. Creates missing directories when permitted.
Instructions
Write text content to a policy-allowed file path.
Writes are performed safely with temporary-file + atomic move.
Existing files are backed up as <path>.backup.<timestamp>.
Args: file_path: Destination file path. content: UTF-8 text payload to persist. create_dirs: If True, creates missing parent directories when directory path is also policy-allowed.
Returns:
JSON string in unified {ok, data|error} contract.
On success, data contains {"success": true, "path": ...}.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| content | Yes | ||
| file_path | Yes | ||
| create_dirs | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |