We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d460c1e commit 559cbaaCopy full SHA for 559cbaa
1 file changed
src/spikeinterface/core/recording_tools.py
@@ -131,14 +131,13 @@ def write_binary_recording(
131
data_size_bytes = dtype_size_bytes * num_frames * num_channels
132
file_size_bytes = data_size_bytes + byte_offset
133
134
- # create a file with file_size_bytes
+ # Create an empty file with file_size_bytes
135
file = open(file_path, "wb+")
136
- if platform.system() == "Windows":
137
- file.seek(file_size_bytes - 1)
138
- file.write(b"\0")
139
- else:
140
- file.truncate(file_size_bytes)
+
+ # The previous implementation `file.truncate(file_size_bytes)` was slow on Windows (#3408)
+ file.seek(file_size_bytes - 1)
141
file.write(b"\0")
142
file.close()
143
assert Path(file_path).is_file()
144
0 commit comments