because that creates a race condition. Instead, use the sysopen() function.unless (-e $file) { open FILE, "> $file"; # ... }
use POSIX qw( O_EXCL O_CREAT ); $perm = 0644; # or whatever sysopen FILE, $file, O_EXCL | O_CREAT, $perm or die "can't create $fil +e: $!";
In reply to Re: is there a file/directory?
by japhy
in thread is there a file/directory?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |