From 47b3f41f5dd2928dc30a37a0b851c8d14be31caf Mon Sep 17 00:00:00 2001 From: tuxuser Date: Sat, 25 Nov 2017 23:43:22 +0100 Subject: [PATCH] dump_file: Switch from "stat" to "ls" for getting filesize - recent firmware prevents using "stat", "ls" however is supported on old and new firmware. --- dump-file.py | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/dump-file.py b/dump-file.py index 3b42e54..1f106f9 100755 --- a/dump-file.py +++ b/dump-file.py @@ -15,14 +15,21 @@ def read_uint32(data, offset): return struct.unpack_from('= 7: + for field in fields[3:]: + if field.isdigit(): + return int(field) + + _logger.debug("ls output: %s", output) + raise RuntimeError("Cannot find filesize for path %s" % path) @contextmanager def laf_open_ro(comm, filename):