Skip to content

Commit

Permalink
Update recording_tools.py
Browse files Browse the repository at this point in the history
Update the method to create an empty file with the right size
  • Loading branch information
jiumao2 committed Sep 13, 2024
1 parent 72d072a commit 0f0c72e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/spikeinterface/core/recording_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,10 @@ def write_binary_recording(
data_size_bytes = dtype_size_bytes * num_frames * num_channels
file_size_bytes = data_size_bytes + byte_offset

# create a file with file_size_bytes
file = open(file_path, "wb+")
file.truncate(file_size_bytes)
file.seek(file_size_bytes - 1)
file.write(b'\0')
file.close()
assert Path(file_path).is_file()

Expand Down

0 comments on commit 0f0c72e

Please sign in to comment.