Your code is readable to the point of needing no explanation. Well done. I believe the up-to-date idiom for importing from the standard library is to make it explicit:
`import std / [os, streams, strformat, times]` I'm less certain about which is idiomatic when it comes to `try/finally` versus `defer` (<https://nim-lang.org/docs/manual.html#exception-handling-defer-statement>). This guidance may not be helpful at all since you're trying to handle an `IOError` explicitly; and `defer` does not allow that level of granularity. In addition to what @blackmius said about `proc/func`, I would add this. If you aren't yet familiar with functional programming, do learn about it sooner rather than later. I'm not plugging the language Haskell, but the book [Learn You a Haskell](https://www.learnyouahaskell.com/) is a fun and free read. And learn about the benefits of writing funcs where possible, tolerating procs where necessary.