Delete File
Delete File
Section titled “Delete File”Type: delete-file · Package: Filesystem Activities v1.0.6
Deletes a file. If the file does not exist, it does nothing (it does not fail). Use it to clean up temporary files, remove downloads already processed or free working space.
How it works
Section titled “How it works”Deletes the file at path. If it does not exist, the activity carries on without error and logs a warning: File not found; nothing to delete. It is idempotent: safe to repeat or retry.
- It only deletes files: if
pathpoints to a folder, it is not removed (treated as “not found”). - It does not accept wildcards: to delete several files, list them with List Files and delete each one.
Required parameters
Section titled “Required parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
path | string | — | Path of the file to delete. |
Optional parameters
Section titled “Optional parameters”None.
Output
Section titled “Output”This activity does not return a value.
Common errors
Section titled “Common errors”| Message | Cause and fix |
|---|---|
The process cannot access the file '…' because it is being used by another process. | The file is open in another program. Close it first, or retry with Retry and a delay. |
Access to the path '…' is denied. | No permission to delete, or the file is read-only. |
'path' is required. | The path expression evaluated to null. |
Example
Section titled “Example”Use a temporary file and delete it at the end:
Write File path = "C:/temp/work.txt" content = data → output: tempPath... process ...Delete File path = tempPathClear the .tmp files from a working folder:
List Files path = "C:/work" pattern = "*.tmp" → output: tempFilesFor Each items = tempFiles itemVariable = path └─ activities: Delete File path = pathRelated activities
Section titled “Related activities”- Move File — archive instead of deleting.
- File Exists — check first (although Delete does not fail if it is missing).