[cfe-commits] [PATCH] Use temporary file for output

Daniel Dunbar daniel at zuster.org
Thu Sep 16 08:13:11 PDT 2010


Hi Argiris,

Looks pretty good, two comments on createOutputFile though.

We should still go ahead and unlink the output file immediately,
even when using temporary files. We shouldn't leave the output
file around in the case of failure. This should make the test
suite change in this patch unnecessary.

Also, I personally think
> +  std::string OSFile = OutFile;
...
> +      OSFile = TempFile;
is easier to follow than using the ternary operator, but that's me.

 - Daniel

On Thu, Sep 16, 2010 at 6:30 AM, Argyrios Kyrtzidis <kyrtzidis at apple.com> wrote:
> Attached patch uses a temporary file for output which gets renamed after all
> the writing is finished. This mainly prevents failures and/or crashes when
> multiple processes try to read/write the same PCH file.
> (rdar://8392711&8294781)
> Please review.
> -Argiris
>
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
>



More information about the cfe-commits mailing list