Writing to a file open with read permissions panics instead of returning error #3880
Labels
breaking
Implementing this issue could cause existing code to no longer compile or have different behavior.
bug
Observed behavior contradicts documented or intended behavior
contributor friendly
This issue is limited in scope and/or knowledge of Zig internals.
standard library
This issue involves writing Zig code for the standard library.
Milestone
Hi,
Running macOS Catalina and zig 0.5.0+5874cb04b.
On macOS Catalina, When calling f.write() on a file opened with File.openRead(), zig panics on EBADF, which in has a comment saying "always a race condition" and does not return an error. This is a single-threaded program. EBADF seems to be the proper error for writing to a file open for reading and is not a race condition:
[EBADF] fildes is not a valid file descriptor open for writing.
This seems to be related to this bug but not 100% sure.
Here is the error trace:
Please let me know if you need anything else from me
The text was updated successfully, but these errors were encountered: