safe_write_file
Overwrite an existing text file only when its current SHA-256 matches the expected hash, then verify the stored result to prevent accidental or conflicting changes.
Instructions
Overwrite an existing text file only when its current SHA-256 matches expected_sha256, then verify the stored result. Prefer this over write_file for existing files; requires WISP_ALLOW_FILE_WRITES.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Path in the selected server filesystem, starting from its root. | |
| content | Yes | Complete replacement UTF-8 text content. | |
| server_id | No | Wisp server ID. Omit to use the configured WISP_SERVER_ID default. | |
| expected_sha256 | Yes | 64-character SHA-256 from the most recent read or fingerprint of the same file. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||