File Operations
Copy, move, and delete files.
3 modules
| Module | Description |
|---|---|
| Salin File | Salin file ke lokasi lain |
| Hapus File | Hapus file dari filesystem |
| Pindahkan File | Pindahkan atau ganti nama file |
Modules
Salin File
file.copy
Salin file ke lokasi lain
Parameters:
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
source | string | Yes | - | Path to the source file |
destination | string | Yes | - | Path where the file will be saved |
overwrite | boolean | No | False | Replace the file if it already exists |
Output:
| Field | Type | Description |
|---|---|---|
copied | boolean | Yang disalin |
source | string | Yang disalin |
destination | string | Yang disalin |
size | number | Sumber |
Example: Backup file
yaml
source: data/important.csv
destination: backup/important.csv
overwrite: trueExample: Duplicate configuration
yaml
source: config.yaml
destination: config.backup.yamlHapus File
file.delete
Hapus file dari filesystem
Parameters:
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
path | string | Yes | - | Path to the file |
ignore_missing | boolean | No | False | Skip without error if file does not exist |
Output:
| Field | Type | Description |
|---|---|---|
deleted | boolean | Yang dihapus |
file_path | string | Yang dihapus |
Example: Delete temporary file
yaml
file_path: /tmp/temp.txt
ignore_missing: trueExample: Delete log file
yaml
file_path: logs/app.logPindahkan File
file.move
Pindahkan atau ganti nama file
Parameters:
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
source | string | Yes | - | Path to the source file |
destination | string | Yes | - | Path where the file will be saved |
Output:
| Field | Type | Description |
|---|---|---|
moved | boolean | Yang dipindahkan |
source | string | Yang dipindahkan |
destination | string | Yang dipindahkan |
Example: Move file to archive
yaml
source: data/input.csv
destination: archive/input_2024.csvExample: Rename file
yaml
source: report.txt
destination: report_final.txt