Skip to content

Filedelete

flowtask.components.FileDelete

FileDelete

FileDelete(loop=None, job=None, stat=None, **kwargs)

Bases: FileBase

FileDelete

Overview

This component remove all files in a Directory.

.. table:: Properties :widths: auto

+--------------+----------+-----------+-------------------------------------------------------+ | Name | Required | Summary | +--------------+----------+-----------+-------------------------------------------------------+ | file | Yes | A dictionary containing two values, "pattern" and "value", | | | | "pattern" and "value", "pattern" contains the path of the | | | | file on the server, If it contains the mask "{value}", then | | | | "value" is used to set the value of that mask | +--------------+----------+-----------+-------------------------------------------------------+ | pattern | Yes | Allows you to replace values ( ".xls", ".csv", ) | +--------------+----------+-----------+-------------------------------------------------------+ | directory | Yes | The directory where are the files to delete | +--------------+----------+-----------+-------------------------------------------------------+ | value | Yes | Name of the function and the arguments it receives for example | | | | [ "current_date", { "mask":"%Y&m%d" } -> 20220909 | +--------------+----------+-----------+-------------------------------------------------------+ | dictionary | Yes | Path where to validate if the file exist | +--------------+----------+-----------+-------------------------------------------------------+

Example:

```yaml
FileDelete:
  file:
    pattern: '*.csv'
    value: ''
  directory: /home/ubuntu/symbits/bayardad/files/job_advertising/bulk/
```

close async

close()

Method.

run async

run()

Delete File(s).