Closed mwgamera closed 9 years ago
Never looked at %openfile and friends, so I don't know much about this (well, strictly speaking I'm very much an es beginner generally). Your workaround seems good, but is it the sort of thing that should go in initial.es? i.e. is there a cleaner solution? Is there some reason to not have this kind of workaround in the basic setup, but instead force people to do it manually if necessary (flexibility?)? I know, strictly speaking it's always 'necessary', but...
Suggestions?
Much cleaner solution would be to fix the underlying $&openfile primitive. I opened the issue because I won't do this myself in any foreseeable future. The workaround above should work just fine when put into initial.es, but it's still just a workaround.
This just bit me the yesterday... now I regret not getting round to putting your workaround in my esrc at least. Didn't realise a simple SIGINT would cause this.
Awesome, thanks!
When exception is thrown from inside of any command with redirected I/O ($&openfile), the opened file is left open with no possibility to close it.
As a simple workaround, one could catch all the exceptions and manually pass them ‘outside’ the
$&openfile
for example this way: