in reply to RE: RE: Don't Check for Directories
in thread Checking for Directories

You can report the failure, but not the reason (the file creation will fail for "no such directory" but we won't know why the directory creation failed). I've worked too long in "Support"; I hate programs that fail and give no hint as to why. Or are you suggesting we cache $! after the mkdir and report it if the next file creation failed??

Good point on the race condition.

I don't like the follow-up suggestion of using system("mkdir -p"), since you lose portability. But using use File::Path qw(mkpath) makes sense, especially since it is smart enough to remove the most common race condition.