Skip to content

File Operations

Copy, move, and delete files.

3 modules

ModuleDescription
ファイルコピーファイルを別の場所にコピーする
ファイル削除ファイルシステムからファイルを削除する
ファイル移動ファイルを移動または名前変更する

Modules

ファイルコピー

file.copy

ファイルを別の場所にコピーする

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
copiedbooleanコピーが成功したかどうか
sourcestringコピー元のパス
destinationstringコピー先のパス
sizenumberファイルサイズ

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

ファイル削除

file.delete

ファイルシステムからファイルを削除する

Parameters:

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

Output:

FieldTypeDescription
deletedboolean削除が成功したかどうか
file_pathstring削除されたファイルのパス

Example: Delete temporary file

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

Example: Delete log file

yaml
file_path: logs/app.log

ファイル移動

file.move

ファイルを移動または名前変更する

Parameters:

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

Output:

FieldTypeDescription
movedboolean移動が成功したかどうか
sourcestring移動元のパス
destinationstring移動先のパス

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.