Talk:Append a record to the end of a text file: Difference between revisions

Content added Content deleted
Line 73: Line 73:


BTW: On unix (and linux) single writes on files opened with appends are guaranteed to append. And the syscall to "write" is atomic. Hence locking is not required. HOWEVER both the C code and the Python code use printf, and I confess that I am not 100% sure if a "fflush" is called when a printf includes a "\n". I'll take a look.
BTW: On unix (and linux) single writes on files opened with appends are guaranteed to append. And the syscall to "write" is atomic. Hence locking is not required. HOWEVER both the C code and the Python code use printf, and I confess that I am not 100% sure if a "fflush" is called when a printf includes a "\n". I'll take a look.

(found: http://stackoverflow.com/questions/2131463/fork-and-printf => suggests the fprintf should be replaced with a sprintf/write, not simply a fprintf/fflush)


ThanX again. [[User:NevilleDNZ|NevilleDNZ]] 14:28, 26 September 2011 (UTC)
ThanX again. [[User:NevilleDNZ|NevilleDNZ]] 14:28, 26 September 2011 (UTC)