diff options
author | Christian Hesse <mail@eworm.de> | 2023-01-31 14:59:13 +0100 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2023-01-31 15:18:17 +0100 |
commit | f666d2f8fffd7cefc4aa590533f47e7c7d14abd7 (patch) | |
tree | b1a1ff00059cf079054c87c31f0b4d6c77944a90 /global-functions | |
parent | f62328ee8db1aee7efa199081f9d52bba0e61eb2 (diff) |
global-functions: $WaitForFile: allow to give iterations...
... to increase timeout. Every iteration is about 100ms.
Diffstat (limited to 'global-functions')
-rw-r--r-- | global-functions | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/global-functions b/global-functions index dfb76f7..165ac9a 100644 --- a/global-functions +++ b/global-functions @@ -1213,14 +1213,16 @@ # wait for file to be available :set WaitForFile do={ :local FileName [ :tostr $1 ]; + :local Iter [ :tonum $2 ]; :global CleanFilePath; + :global EitherOr; :set FileName [ $CleanFilePath $FileName ]; :local I 0; :while ([ :len [ /file/find where name=$FileName ] ] = 0) do={ - :if ($I > 20) do={ + :if ($I > [ $EitherOr $Iter 20 ]) do={ :return false; } :delay 100ms; |