a simple random-access file implementaion