This avoids confusing contextless error messages such as "No such file or directory" if e.g. the pdb output file should be written to a nonexistent directory. (This can happen with linkrepro scripts, at least old ones.)
As this is more or less NFC, is it ok without a test?