perl - Using -d to check if dir exists fails sometimes -


-d $dir or make_path( $dir) or die "can't mkdir $dir: $!"; 

i have line of code, less 1% of time script fails saying:

mkdir <$dir path>: file exists @ script.pl line 234 

anything wrong way used "-d" , "or" ?

it sounds trying create directory same name existing (plain) file. -d returns false since target not directory. make_path dies since can't create requested directory.


Comments

Popular posts from this blog

cakephp - simple blog with croogo -

How to group boxplot outliers in gnuplot -

bash - Performing variable substitution in a string -