Use posix open/read/write/close as it seems to be much faster than stdio.