only write a file if it does not already exist