mirror of
https://git.eworm.de/cgit/routeros-scripts
synced 2025-08-02 09:15:03 +02:00
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:
parent
d70efe910a
commit
8231c3e833
1 changed files with 10 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue