Skip to main content

Wait for File

Command description

Wait for the specified path to be created or deleted and return whether the event occurred before the timeout.

Command Input Parameters

input parametersInput parameter typeDescription
File PathstrFile path to wait for
Wait for File EventenumCreate, Delete
Timeoutnumber or strMaximum waiting time, in seconds

Command Output Parameters

Output parametersOutput parameter typeDescription
Wait ResultboolTrue if the event occurs; False if the command times out

Edge Cases

  • When waiting for Create, returns True immediately if the path already exists; returns False if the path is still absent when the timeout expires.
  • When waiting for Delete, returns True immediately if the path is already absent; returns False if the path still exists when the timeout expires.
  • The command uses os.path.exists, so both files and folders count as existing. A timeout returns False instead of raising a timeout exception.
  • Wait Type must be Create or Delete, and Timeout must be numeric.

Generation Notes

  • Wait for creation or deletion. A timeout returns False and does not raise an exception.