diff options
author | Christian Hesse <mail@eworm.de> | 2024-12-11 10:40:06 +0100 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2024-12-17 11:20:09 +0100 |
commit | 8231c3e833ee83a118f4d8395c097e6a9f312c2f (patch) | |
tree | 535d7bf3046740e8d8dc9ff4500749199e433488 | |
parent | d70efe910ae3a9bef3ee6b62c0fd6d591bab89e3 (diff) |
global-functions: $WaitForFile: delay until "complete"...
Well, turns out that waiting for existence of a file is not sufficient.
Chances are that a file is available just partly, so wait until the size
no longer changes... Let's hope that works as expected. 🤞
-rw-r--r-- | global-functions.rsc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/global-functions.rsc b/global-functions.rsc index 625f8cd..e5e5d50 100644 --- a/global-functions.rsc +++ b/global-functions.rsc @@ -1577,6 +1577,16 @@ :delay $Delay; :set I ($I + 1); } + + :local File [ /file/find where name=$FileName ]; + :local SizeA 0; + :local SizeB 1; + :while ($SizeA < $SizeB) do={ + :set SizeA $SizeB; + :delay $Delay; + :set SizeB [ /file/get $File size ]; + } + :return true; } |