diff options
author | Philipp Maier <pmaier@sysmocom.de> | 2020-05-11 21:48:33 +0200 |
---|---|---|
committer | Harald Welte <laforge@osmocom.org> | 2020-05-17 09:38:10 +0200 |
commit | 32daaf547020d56753286f1ec4a7a6096804cde4 (patch) | |
tree | 3aa6ee8ec53f4b0dd84ba7bf78404e2c9a688ed6 | |
parent | e8536c04bc48daa4273124de25218cba7e547cc2 (diff) |
commands: add method to determine size of a non record oriented file
For record oriented files we have the methods record_size() and
record_count() to determine the dimensions of a record oriented file,
however, we miss a similar function for regular binary files. Lets add a
method binary_size() to quickly determine the size of a non record
oriented file
Change-Id: I0593f2de7f34d5654a19e949dc567a236e44e20c
-rw-r--r-- | pySim/commands.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/pySim/commands.py b/pySim/commands.py index cc7acc6..30e995c 100644 --- a/pySim/commands.py +++ b/pySim/commands.py @@ -152,6 +152,10 @@ class SimCardCommands(object): r = self.select_file(ef) return self.__len(r) // self.__record_len(r) + def binary_size(self, ef): + r = self.select_file(ef) + return self.__len(r) + def run_gsm(self, rand): if len(rand) != 32: raise ValueError('Invalid rand') |