I was wondering if there was any benefit/detriment to using output redirection on unix, compared to calling fprintf(file, ...);
edit: to further clarify. I'm writing a program that will need to do a data dump to disk: 50000+ lines by 40 characters of data.
The program itself takes up a significant amount of memory as it is, and I need to know whether or not allocating a buffer inside the program will incur a bigger memory penalty than using a unix output redirect.
I have noticed that the difference in output time is within margin of error. Both are very efficient and the only difference is that I need to write extra code for writing to a file without unix redirects.
However, most of my attempts at benchmarking have run up against the same issue: they don't show how much memory is allocated for the buffered output if I use output redirection.