aboutsummaryrefslogtreecommitdiffstats
path: root/global-functions.rsc
diff options
context:
space:
mode:
Diffstat (limited to 'global-functions.rsc')
-rw-r--r--global-functions.rsc18
1 files changed, 6 insertions, 12 deletions
diff --git a/global-functions.rsc b/global-functions.rsc
index 85818b4..a2dd279 100644
--- a/global-functions.rsc
+++ b/global-functions.rsc
@@ -1,6 +1,6 @@
#!rsc by RouterOS
# RouterOS script: global-functions
-# Copyright (c) 2013-2024 Christian Hesse <mail@eworm.de>
+# Copyright (c) 2013-2025 Christian Hesse <mail@eworm.de>
# Michael Gisbers <michael@gisbers.de>
# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md
#
@@ -479,9 +479,13 @@
:local FileSize [ /file/get $FileName size ];
:local Return "";
:local VarSize 0;
- :while ($VarSize < $FileSize) do={
+ :while ($VarSize != $FileSize) do={
:set Return ($Return . ([ /file/read offset=$VarSize chunk-size=32768 file=$FileName as-value ]->"data"));
+ :set FileSize [ /file/get $FileName size ];
:set VarSize [ :len $Return ];
+ :if ($VarSize > $FileSize) do={
+ :delay 100ms;
+ }
}
/file/remove $DirName;
:return $Return;
@@ -1587,16 +1591,6 @@
: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;
}