I have the following code:
Program received signal SIGSEGV, Segmentation fault.
__GI__IO_fputs (str=0x4a864 "1000001\t0\t70\t1\n", fp=0x0) at iofputs.c:38
38 iofputs.c: No such file or directory.
You did not check the result of
according to the error message
fpis 0, meaning
fopen has failed.
I would guess, the tmpDir is non-existent or non-accessable