global-functions: $WaitForFile: use :retry for simplification, ...

... and to work around restrictions in new file handling.
This commit is contained in:
Christian Hesse 2025-05-30 21:25:20 +02:00
parent e08bb2192d
commit 0e00a228d6

View file

@ -1746,16 +1746,14 @@
:global MAX; :global MAX;
:set FileName [ $CleanFilePath $FileName ]; :set FileName [ $CleanFilePath $FileName ];
:local I 1;
:local Delay ([ $MAX [ $EitherOr $WaitTime 2s ] 100ms ] / 10); :local Delay ([ $MAX [ $EitherOr $WaitTime 2s ] 100ms ] / 10);
:while ([ :len [ /file/find where name=$FileName ] ] = 0) do={ :do {
:if ($I >= 10) do={ :retry {
:return false; /file/get $FileName;
} :return true;
:delay $Delay; } delay=$Delay max=10;
:set I ($I + 1); } on-error={ }
}
:return false; :return false;
} }