Filerename¶
flowtask.components.FileRename
¶
FileRename
¶
Bases: FileBase
FileRename.
Overview
This component renames a file asynchronously based on provided source and destination paths. It supports handling missing files and offers optional behavior for ignoring missing source files. It performs basic validation to ensure the destination doesn't overwrite existing files.
.. table:: Properties :widths: auto
+--------------------------+----------+---------------------------------------------------------------------------------------------------+
| Name | Required | Description |
+--------------------------+----------+---------------------------------------------------------------------------------------------------+
| directory (str) | Yes | Path to the directory containing the source file. |
+--------------------------+----------+-----------+---------------------------------------------------------------------------------------+
| destination (str) | Yes | New filename (with optional variable replacement using set_variables and mask_replacement) |
| | | for the file. |
+--------------------------+----------+-----------+---------------------------------------------------------------------------------------+
| ignore_missing (bool) | No | Flag indicating whether to ignore missing source files (defaults to False). |
+--------------------------+----------+---------------------------------------------------------------------------------------------------+
| source (str) | Yes | Filename (with optional variable replacement using set_variables and mask_replacement) |
| | | of the file to rename. |
+--------------------------+----------+-----------+---------------------------------------------------------------------------------------+
Example:
```yaml
FileRename:
Group: ICIMSRename
ignore_missing: true
directory: /home/ubuntu/symbits/icims/files/forms/
source: '{form_id}_{form_data_id}.txt'
destination: '{form_id}_{form_data_id}_{associate_id} - {full_name}.txt'
```