Skip to content

Commit

Permalink
Update recording_tools.py
Browse files Browse the repository at this point in the history
  • Loading branch information
jiumao2 committed Sep 15, 2024
1 parent 559cbaa commit af6c618
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/spikeinterface/core/recording_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,13 +132,11 @@ def write_binary_recording(
file_size_bytes = data_size_bytes + byte_offset

# Create an empty file with file_size_bytes
file = open(file_path, "wb+")
with open(file_path, "wb+") as file:
# The previous implementation `file.truncate(file_size_bytes)` was slow on Windows (#3408)
file.seek(file_size_bytes - 1)
file.write(b"\0")

# The previous implementation `file.truncate(file_size_bytes)` was slow on Windows (#3408)
file.seek(file_size_bytes - 1)
file.write(b"\0")

file.close()
assert Path(file_path).is_file()

# use executor (loop or workers)
Expand Down

0 comments on commit af6c618

Please sign in to comment.