Page MenuHomePhabricator

[libcxx] Cleanup the cleanup of temporary files.

Authored by EricWF on Dec 19 2014, 12:51 PM.



The pythonic way to guard resources is using a with statement. This patch adds a class that allows the creation and deletion of temporary files using a with statement.

Diff Detail

Event Timeline

EricWF updated this revision to Diff 17509.Dec 19 2014, 12:51 PM
EricWF retitled this revision from to [libcxx] Cleanup the cleanup of temporary files..
EricWF updated this object.
EricWF edited the test plan for this revision. (Show Details)
EricWF added reviewers: mclow.lists, danalbert, jroelofs.
EricWF added a subscriber: Unknown Object (MLST).
mclow.lists edited edge metadata.Dec 20 2014, 9:44 AM

This looks reasonable to me.


Can self._evaluate_test throw?

If so, you'll skip the call to _clean.
On the other hand, _clean appears to be empty now.

EricWF added inline comments.Dec 22 2014, 11:27 AM

I would like @danalbert to comment on this. I think he uses _clean() in the android configuration.

danalbert added inline comments.Jan 5 2015, 3:13 PM

_clean() should be thought of as a virtual method. It needs to be overridden for remote execution because the steps taken to clean up remote workspaces will vary.

danalbert added inline comments.Jan 12 2015, 12:24 PM

Doesn't contextlib cover this?

EricWF abandoned this revision.Feb 20 2015, 9:25 AM

This is no longer relevant.