Skip to content

Commit

Permalink
go to the end of the file before appending
Browse files Browse the repository at this point in the history
  • Loading branch information
danielhrisca committed Sep 17, 2024
1 parent 38e811d commit 254664a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/asammdf/blocks/mdf_v3.py
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,7 @@ def _load_data(
data.append(stream.read(min(record_count, size)))
else:
data.append(stream.read(size))

cur_size += size
offset += size

Expand Down Expand Up @@ -2042,6 +2043,8 @@ def append(

block = samples.tobytes()

self._tempfile.seek(0, 2)

gp.data_location = v23c.LOCATION_TEMPORARY_FILE
if cycles_nr:
data_address = tell()
Expand All @@ -2059,9 +2062,6 @@ def append(
)
)

else:
gp.data_location = v23c.LOCATION_TEMPORARY_FILE

self.virtual_groups_map[dg_cntr] = dg_cntr
if dg_cntr not in self.virtual_groups:
self.virtual_groups[dg_cntr] = VirtualChannelGroup()
Expand Down

0 comments on commit 254664a

Please sign in to comment.