modify ctime only when writing to file, prevents message "file has changed"