fix touch existing file
add new "eof" option to write