update mode logic to read and write
0.6.0

* add `mode` support for files