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. 🤞
This commit is contained in:
Christian Hesse 2024-12-11 10:40:06 +01:00
parent d70efe910a
commit 8231c3e833

View file

@ -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;
}