Skip to content

File Operations

Copy, move, and delete files.

3 modules

ModuleDescription
Copiar ArquivoCopiar arquivo para outra localizacao
Excluir ArquivoExcluir arquivo do sistema de arquivos
Mover ArquivoMover ou renomear arquivo

Modules

Copiar Arquivo

file.copy

Copiar arquivo para outra localizacao

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
copiedbooleanO copiado
sourcestringO copiado
destinationstringO copiado
sizenumberA origem

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

Excluir Arquivo

file.delete

Excluir arquivo do sistema de arquivos

Parameters:

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

Output:

FieldTypeDescription
deletedbooleanO excluido
file_pathstringO excluido

Example: Delete temporary file

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

Example: Delete log file

yaml
file_path: logs/app.log

Mover Arquivo

file.move

Mover ou renomear arquivo

Parameters:

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

Output:

FieldTypeDescription
movedbooleanO movido
sourcestringO movido
destinationstringO 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.