NetLogo/NetLogo — Issue #45: when an (unhanded) runtime error occurs, all open files should be closed
Author: SethTisue
Created: 2011-12-15 02:47:56+00:00
State: open

As `file-close` doesn't throw errors if you try to close file that isn't open, an easy workaround is to use `file-close` before code like this:

```
; Delete a file if exists
if [file-exists filename][
file-delete filename
]
```

Although the workaround exists, it would still really be better if the system closed all open files when a runtime error (unhandled by `carefully`) occurs.

reported by Onno Steenbergen