saip: calculate the number of records for LF and CY

Some templates (e.g. for 5GS) define files which aren't completely defined.
5GS OPL5G: doesn't have a file size defined in the template,
but a record size.

Change-Id: I5ec1757d6852eb24d3662ec1c3fc88365e90a616
This commit is contained in:
Alexander Couzens
2025-12-16 14:54:24 +01:00
committed by laforge
parent 1347d5ffa2
commit 2e7944cc98

View File

@@ -144,6 +144,9 @@ class File:
def file_size(self) -> Optional[int]: def file_size(self) -> Optional[int]:
"""Return the size of the file in bytes.""" """Return the size of the file in bytes."""
if self.file_type in ['LF', 'CY']: if self.file_type in ['LF', 'CY']:
if self._file_size and self.nb_rec is None and self.rec_len:
self.nb_rec = self._file_size // self.rec_len
return self.nb_rec * self.rec_len return self.nb_rec * self.rec_len
elif self.file_type in ['TR', 'BT']: elif self.file_type in ['TR', 'BT']:
return self._file_size return self._file_size