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.