#error.NotOpenForWriting when trying to flush a buffer
1 messages · Page 1 of 1 (latest)
Can you share the code that causes this?
First guess, did you close the file before calling flush?
How did you open the file?
The file is opened like so: try std.fs.cwd().createFile(filename, .{}).
Closing is handled using a defer statement so it doesn't happen while the file is still in use.
Ha, you're absolutely right @cold tartan .
I actually had defer in a premature if condition block 😅
Removing that fixes it. Thanks everyone!