check open before setting position
refactor file data storage & test append mode