2025-12-05 09:55:38 -03:00
|
|
|
# DELETE FILE
|
2025-12-03 19:56:35 -03:00
|
|
|
|
2025-12-05 09:55:38 -03:00
|
|
|
> **Deprecated:** The `DELETE FILE` keyword has been unified into the [`DELETE`](keyword-delete.md) keyword. Use `DELETE` instead.
|
2025-12-03 19:56:35 -03:00
|
|
|
|
2025-12-05 09:55:38 -03:00
|
|
|
---
|
2025-12-03 19:56:35 -03:00
|
|
|
|
2025-12-05 09:55:38 -03:00
|
|
|
## Unified DELETE Keyword
|
2025-12-03 19:56:35 -03:00
|
|
|
|
2025-12-05 09:55:38 -03:00
|
|
|
The `DELETE` keyword now automatically detects file paths and handles file deletion:
|
2025-12-03 19:56:35 -03:00
|
|
|
|
|
|
|
|
```basic
|
2025-12-05 09:55:38 -03:00
|
|
|
' Delete a file - just use DELETE
|
|
|
|
|
DELETE "path/to/file.txt"
|
2025-12-03 19:56:35 -03:00
|
|
|
|
2025-12-05 09:55:38 -03:00
|
|
|
' DELETE auto-detects:
|
|
|
|
|
' - URLs → HTTP DELETE
|
|
|
|
|
' - table, filter → Database DELETE
|
|
|
|
|
' - path → File DELETE
|
2025-12-03 19:56:35 -03:00
|
|
|
```
|
|
|
|
|
|
2025-12-05 09:55:38 -03:00
|
|
|
---
|
2025-12-03 19:56:35 -03:00
|
|
|
|
2025-12-05 09:55:38 -03:00
|
|
|
## Migration
|
2025-12-03 19:56:35 -03:00
|
|
|
|
2025-12-05 09:55:38 -03:00
|
|
|
### Old Syntax (Deprecated)
|
2025-12-03 19:56:35 -03:00
|
|
|
|
|
|
|
|
```basic
|
2025-12-05 09:55:38 -03:00
|
|
|
' Old way - no longer needed
|
|
|
|
|
DELETE FILE "temp/report.pdf"
|
2025-12-03 19:56:35 -03:00
|
|
|
```
|
|
|
|
|
|
2025-12-05 09:55:38 -03:00
|
|
|
### New Syntax (Recommended)
|
2025-12-03 19:56:35 -03:00
|
|
|
|
|
|
|
|
```basic
|
2025-12-05 09:55:38 -03:00
|
|
|
' New way - unified DELETE
|
|
|
|
|
DELETE "temp/report.pdf"
|
2025-12-03 19:56:35 -03:00
|
|
|
```
|
|
|
|
|
|
2025-12-05 09:55:38 -03:00
|
|
|
---
|
2025-12-03 19:56:35 -03:00
|
|
|
|
2025-12-05 09:55:38 -03:00
|
|
|
## Examples
|
2025-12-03 19:56:35 -03:00
|
|
|
|
|
|
|
|
```basic
|
2025-12-05 09:55:38 -03:00
|
|
|
' Delete a temporary file
|
|
|
|
|
DELETE "temp/processed.csv"
|
2025-12-03 19:56:35 -03:00
|
|
|
|
2025-12-05 09:55:38 -03:00
|
|
|
' Delete uploaded file
|
|
|
|
|
DELETE "uploads/" + filename
|
2025-12-03 19:56:35 -03:00
|
|
|
|
2025-12-05 09:55:38 -03:00
|
|
|
' Delete with error handling
|
|
|
|
|
ON ERROR RESUME NEXT
|
|
|
|
|
DELETE "temp/large-file.pdf"
|
|
|
|
|
IF ERROR THEN
|
|
|
|
|
TALK "Could not delete file: " + ERROR MESSAGE
|
2025-12-03 19:56:35 -03:00
|
|
|
END IF
|
2025-12-05 09:55:38 -03:00
|
|
|
ON ERROR GOTO 0
|
2025-12-03 19:56:35 -03:00
|
|
|
```
|
|
|
|
|
|
2025-12-05 09:55:38 -03:00
|
|
|
---
|
2025-12-03 19:56:35 -03:00
|
|
|
|
|
|
|
|
## See Also
|
|
|
|
|
|
2025-12-05 09:55:38 -03:00
|
|
|
- [DELETE](keyword-delete.md) — Unified delete keyword (HTTP, Database, File)
|
|
|
|
|
- [READ](keyword-read.md) — Read file contents
|
|
|
|
|
- [WRITE](keyword-write.md) — Write file contents
|
|
|
|
|
- [COPY](keyword-copy.md) — Copy files
|
|
|
|
|
- [MOVE](keyword-move.md) — Move/rename files
|