in reply to is there a file/directory?
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: $!";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: is there a file/directory?
by japhy (Canon) on May 29, 2001 at 23:14 UTC |