Good point. But remember that TOCTOU might be a problem. mkdir $directory, check $!, and ignore EEXIST ("File exists"). After that, $directory may still be something non-directory, but you will know that when chdir $directory or open(...,"$directory/filename") fails with ENOTDIR ("Not a directory").
Alexander
In reply to Re^2: Handling returns from mkdir.
by afoken
in thread Handling returns from mkdir.
by dannyd
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |