Clean up file r/w