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

Content added Content deleted
(→‎Changed: new section)
Line 69: Line 69:


I changed the task so that it was self consistent. We can probably delete a lot of the above commentary now. Some of the existing implementations should perhaps be marked incorrect. --[[User:Rdm|Rdm]] 14:00, 26 September 2011 (UTC)
I changed the task so that it was self consistent. We can probably delete a lot of the above commentary now. Some of the existing implementations should perhaps be marked incorrect. --[[User:Rdm|Rdm]] 14:00, 26 September 2011 (UTC)

ThanX for spotting the email/home/shell error . I've fixed the C and python code.

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.

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