Breadcrumbs

Workflows Helper - Check If File Exists

Overview

How to use the Check If File Exists Helper

1. Provide inputs:

–filepath (optional, defaults to current directory) –filename (required must include the extension after the .)

2. Run example:

python checkiffile_exists.py --filename name.txt --folderpath /path/to/file/

3. Output:

Success: 'name.txt' exists in '/path/to/file/'

Variables

Name

Reference

Type

Required

Default

Options

Description

Workflows Folder Path

FOLDER_PATH

Alphanumeric

-

-

Relative path to the folder where the file should be located. If left blank, will look in the home directory.

Workflows File Name

FILE_NAME

Alphanumeric

-

-

Name of the file to verify within the specified folder path.

YAML

Below is the YAML template

YAML

source:
  template: Workflows Helper - Check If File Exists
  inputs:
    FOLDER_PATH:
    FILE_NAME:
  type: TEMPLATE
guardrails:
  retry_count: 1
  retry_wait: 0h0m0s
  runtime_cutoff: 1h0m0s
  exclude_exit_code_ranges:
    - 104
    - 105
    - 106
    - 199