Using directory modification times is fraught with peril. Since all we need is to ensure that the directory is there, call `mkdir -p` prior to writing a file.