Skip to content

File Operations

Copy, move, and delete files.

3 modules

ModuleDescription
Copier le fichierCopier un fichier vers un autre emplacement
Supprimer le fichierSupprimer un fichier du systeme de fichiers
Deplacer le fichierDeplacer ou renommer un fichier

Modules

Copier le fichier

file.copy

Copier un fichier vers un autre emplacement

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
copiedbooleanLe copie
sourcestringLe copie
destinationstringLe copie
sizenumberLa source

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

Supprimer le fichier

file.delete

Supprimer un fichier du systeme de fichiers

Parameters:

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

Output:

FieldTypeDescription
deletedbooleanLe supprime
file_pathstringLe supprime

Example: Delete temporary file

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

Example: Delete log file

yaml
file_path: logs/app.log

Deplacer le fichier

file.move

Deplacer ou renommer un fichier

Parameters:

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

Output:

FieldTypeDescription
movedbooleanLe deplace
sourcestringLe deplace
destinationstringLe deplace

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.