Skip to content

File Operations

Copy, move, and delete files.

3 modules

ModuleDescription
Copiar archivoCopiar un archivo a otra ubicacion
Eliminar archivoEliminar un archivo del sistema de archivos
Mover archivoMover o renombrar un archivo

Modules

Copiar archivo

file.copy

Copiar un archivo a otra ubicacion

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
copiedbooleanEl copiado
sourcestringEl copiado
destinationstringEl copiado
sizenumberEl origen

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

Eliminar archivo

file.delete

Eliminar un archivo del sistema de archivos

Parameters:

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

Output:

FieldTypeDescription
deletedbooleanEl eliminado
file_pathstringEl eliminado

Example: Delete temporary file

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

Example: Delete log file

yaml
file_path: logs/app.log

Mover archivo

file.move

Mover o renombrar un archivo

Parameters:

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

Output:

FieldTypeDescription
movedbooleanEl movido
sourcestringEl movido
destinationstringEl movido

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.