Implement writing for record based files