I have my own implementation of _open()
, _close()
, _write()
, _read()
.
My code:
FILE *f = fopen("0:test", "wb"); // calls _open()
fwrite("hello ", 6, 1, f);
fwrite("world\r\n\0", 8, 1, f); // calls _write(3, "hello world\r\n", 13)
fflush(f); // calls _write(3, "\0", 1)
fclose(f); // calls _close(3)
BUFSIZE
is 1024
Compiler: arm-none-eabi-gcc
/ Version: 5.4.1
Why does fwrite()
interpret '\n'
even though I have the flags "wb"
?
Does fopen()
interpret the filename "0:test"
?
setvbuf()
and friends... – Waiver