Hi,
First of all greate work.
Second of all, I found that you are missing fundamental function in case of working with file and it is a "close file" function or maybe I'm missing some point. In that case please correct me. Otherwise, if you could add it that would be greate.
Best Regards.