I\'m writing out a large numerical 2 dimensional array to a binary file (final size ~75 MB).
I\'m doing this on a linux system. First, is there a better method or s
You can find the source of fwrite in
http://sourceware.org/git/?p=glibc.git;a=blob;f=libio/iofwrite.c;hb=HEAD
As you can see, this in turn calls IO_sputn, which eventually ends up in
http://sourceware.org/git/?p=glibc.git;a=blob;f=libio/fileops.c;hb=HEAD
(specifically, _IO_new_file_xsputn). As you can see, this always goes through the stdio buffer.
So I would advise against using stdio; writing directly using write(2) will bypass this extra copy.