[cfe-commits] [PATCH] Use temporary file for output
Argyrios Kyrtzidis
kyrtzidis at apple.com
Thu Sep 16 14:23:07 PDT 2010
New patch attached.
-Argiris
-------------- next part --------------
A non-text attachment was scrubbed...
Name: temp_output2.diff
Type: application/octet-stream
Size: 8813 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20100916/23bc84a5/attachment.obj>
-------------- next part --------------
On Sep 16, 2010, at 4:13 PM, Daniel Dunbar wrote:
> 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
>>
>>
> _______________________________________________
> 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