As part of the security audit of Nimbus, we're tightening some parts of the file IO we do - one outcome is that we're working on a more reliable IO module where it's easier to reason about code flow, removing long-standing exception safety issues in code in general and add support for some additional platform specific options such as unix permissions which is needed when dealing with sensitive data (ie don't let other users on the system read files)
Have a look and tell us what you think: https://github.com/status-im/nim-stew/pull/53 - it covers what we need but we're happy to expand it for reasonable use cases!