repl:4:> (os/open "bar" :c)
error: No such file or directory
in os/open [src/core/os.c] on line 2524
in thunk [repl] (tail call) on line 4, column 1
repl:5:> (os/open "bar" :crw)
error: No such file or directory
in os/open [src/core/os.c] on line 2524
in thunk [repl] (tail call) on line 5, column 1
When the file is opened in
O_RDWR
mode, theO_CREAT
flag is discarded here: https://github.com/janet-lang/janet/blob/a5d6b2283834422a9fa9e79b5c7ad9b932b52568/src/core/os.c#L2671So, this works:
But this doesn't:
Kudos to @sogaiu for locating the bug on Zulip :)