copy_file
Copy a file to a new path, preserving permissions and creating parent directories. Prevents overwriting unless enabled and supports cross-device copies.
Instructions
Copy a file to a new path, preserving file permissions. Parent directories of to are created if missing. Refuses to overwrite an existing destination unless overwrite=true. Cross-device copies are supported. Notifies the LSP server with FileCreated so diagnostics update immediately. To move or rename a file, use rename_file instead.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | No | Absolute path, file:// URI, or workspace-relative path of the destination. Parent directories are created automatically. | |
| from | No | Absolute path, file:// URI, or workspace-relative path of the source file. | |
| dirty_ok | No | Allow copying a file that has uncommitted changes. Default false. | |
| overwrite | No | Allow overwriting an existing destination file. Default false. |