Skip to content

Commit

Permalink
feat(packed): enable specifying initial byte order
Browse files Browse the repository at this point in the history
  • Loading branch information
kmnhan committed Apr 3, 2024
1 parent 589bcb2 commit 6670245
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions igor2/packed.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,16 @@
# a later record in the packed file.


def load(filename, strict=True, ignore_unknown=True):
def load(filename, strict=True, ignore_unknown=True, initial_byte_order=None):
logger.debug('loading a packed experiment file from {}'.format(filename))
records = []
if hasattr(filename, 'read'):
f = filename # filename is actually a stream object
else:
f = open(filename, 'rb')
byte_order = None
initial_byte_order = '='
if initial_byte_order is None:
initial_byte_order = '='
try:
while True:
PackedFileRecordHeader.byte_order = initial_byte_order
Expand Down

0 comments on commit 6670245

Please sign in to comment.