Skip to main content

Wait for file

Wait until a file appears and has stopped growing (for example a download or an export), then return its path.

Command in the File toolkit · id ooa.file/wait_for_file · 5 inputs (1 required), 2 outputs

Inputs​

InputTypeRequiredDefaultWhat it is
PathFileYesFile to wait for; the name may use * and ? (e.g. Downloads/report*.xlsx), the newest match wins.
Timeout (seconds)NumberNo60How long to wait at most.
Stable (seconds)NumberNo1The file's size must stay the same for this long, so a file still being written is not taken.
Ignore temporaryBooleanNotrueSkip browser download placeholders (.crdownload, .part, .tmp) and Office lock files (~$...).
Fail on timeoutBooleanNotrueFail with FILE.WAIT_TIMEOUT when time runs out; otherwise found is false.

Outputs​

OutputTypeWhat it is
pathFilePath of the file found; empty when time ran out and fail_on_timeout is off.
foundBooleanTrue when the file was found in time.