DMisener
9/22/2008 3:57:00 PM
On Sep 19, 6:57 am, Robert Dober <robert.do...@gmail.com> wrote:
> On Thu, Sep 18, 2008 at 10:07 PM, Robert Klemme> Oh, come on.
> You can easily use that information to build what you want.
Actually inverting the logic isn't that easy (at least for me)
> Hmm maybe not Robert, my feeling is that they should not do what they
> are doing in the at_exit block.
I'm certainly not married to the the at_exit approach.
> OP can you give us the rationale behind this design. At first sight I
> believe you should do what you want in the main script. Look at Ara's ideas e.g.
Simple problem:
Create a tentative output working file. If the program exits
"cleanly" then rename the work file
to its "final" name. If not leave the work file for possible
examination.
Ideally this File.open_tentative_output_file would be plug
"compatible" with the simple File.open
(i.e. support modes and blocks).
Perhaps I'm trying to make life "too easy" for the application
programmer by eliminating the need for
an explicit File.close_all_pending_tentative_file routine. That is
really all that I am trying to achieve with the
at_exit{} code. One less step to remember. But perhaps the
implementation complexity isn't worth it.
BTW: It sure would be nice to have an on_abort{} handler.