implement and fixes #3
ensure file size is correct when opening them.
#22