Skip to content

File Operations

Copy, move, and delete files.

3 modules

ModuleDescription
Copia FileCopia un file in un'altra posizione
Elimina FileElimina un file dal filesystem
Sposta FileSposta o rinomina un file

Modules

Copia File

file.copy

Copia un file in un'altra posizione

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
copiedbooleanIl file copiato
sourcestringIl file copiato
destinationstringIl file copiato
sizenumberIl sorgente

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

Elimina File

file.delete

Elimina un file dal filesystem

Parameters:

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

Output:

FieldTypeDescription
deletedbooleanIl file eliminato
file_pathstringIl file eliminato

Example: Delete temporary file

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

Example: Delete log file

yaml
file_path: logs/app.log

Sposta File

file.move

Sposta o rinomina un file

Parameters:

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

Output:

FieldTypeDescription
movedbooleanIl file spostato
sourcestringIl file spostato
destinationstringIl file spostato

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.