<p dir="ltr">Of course remember that such atomic semantics are only ensured when moving a file and when both the source and destination are on the same file system. </p>
<div class="gmail_quote">On Jun 7, 2013 8:20 AM, "Phil Turmel" <<a href="mailto:philip@turmel.org">philip@turmel.org</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On 06/07/2013 01:48 AM, Alex Carver wrote:<br>
>> D) Sometimes, if I happen to retrieve the file while it's being written,<br>
>> I get an incomplete result.<br>
><br>
> This would be an expected flaw in the implementation with almost any web<br>
> server. You would have to create a temporary file first, then at the<br>
> last moment copy the temporary file to the permanent location (since the<br>
> copy will be fast versus the writing of several command outputs). The<br>
> only true way to avoid this is with CGI scripting to execute the script<br>
> at time of request.<br>
<br>
Short of CGI, the canonical way to handle this is to *rename* a<br>
temporary file over the normal file. The linux kernel will guarantee<br>
that other processes will see either old or new in their entirety.<br>
<br>
Phil<br>
_______________________________________________<br>
Ale mailing list<br>
<a href="mailto:Ale@ale.org">Ale@ale.org</a><br>
<a href="http://mail.ale.org/mailman/listinfo/ale" target="_blank">http://mail.ale.org/mailman/listinfo/ale</a><br>
See JOBS, ANNOUNCE and SCHOOLS lists at<br>
<a href="http://mail.ale.org/mailman/listinfo" target="_blank">http://mail.ale.org/mailman/listinfo</a><br>
</blockquote></div>