Skip to content

File Operations

Copy, move, and delete files.

3 modules

ModuleDescription
Salin FileSalin file ke lokasi lain
Hapus FileHapus file dari filesystem
Pindahkan FilePindahkan atau ganti nama file

Modules

Salin File

file.copy

Salin file ke lokasi lain

Parameters:

NameTypeRequiredDefaultDescription
sourcestringYes-Path to the source file
destinationstringYes-Path where the file will be saved
overwritebooleanNoFalseReplace the file if it already exists

Output:

FieldTypeDescription
copiedbooleanYang disalin
sourcestringYang disalin
destinationstringYang disalin
sizenumberSumber

Example: Backup file

yaml
source: data/important.csv
destination: backup/important.csv
overwrite: true

Example: Duplicate configuration

yaml
source: config.yaml
destination: config.backup.yaml

Hapus File

file.delete

Hapus file dari filesystem

Parameters:

NameTypeRequiredDefaultDescription
pathstringYes-Path to the file
ignore_missingbooleanNoFalseSkip without error if file does not exist

Output:

FieldTypeDescription
deletedbooleanYang dihapus
file_pathstringYang dihapus

Example: Delete temporary file

yaml
file_path: /tmp/temp.txt
ignore_missing: true

Example: Delete log file

yaml
file_path: logs/app.log

Pindahkan File

file.move

Pindahkan atau ganti nama file

Parameters:

NameTypeRequiredDefaultDescription
sourcestringYes-Path to the source file
destinationstringYes-Path where the file will be saved

Output:

FieldTypeDescription
movedbooleanYang dipindahkan
sourcestringYang dipindahkan
destinationstringYang dipindahkan

Example: Move file to archive

yaml
source: data/input.csv
destination: archive/input_2024.csv

Example: Rename file

yaml
source: report.txt
destination: report_final.txt

Released under the Apache 2.0 License.