in reply to Is the file there?

In cgi scripts, you need to worry about more than one instance running at a time. That requires locking, as well as the exclusivity you want:

my $path = "$dir/$name"; my $fh; use Fcntl; sysopen ( $fh, $path, O_WRONLY|O_EXCL|O_CREAT|O_EXLOCK ) or die $!;
Update: Explicitly added Fcntl to get the symbols defined. Ahbeyra, please say what error messages you get, maybe post some more code.

Update2: Added O_CREAT flag. Props to jeroenes for spotting.

After Compline,
Zaxo

Replies are listed 'Best First'.
Re: Re: Is the file there?
by Ahbeyra (Monk) on Oct 25, 2001 at 07:19 UTC
    When i do that, it dies regardless... is there something i could be doing wrong to causing it?

    -----------------------------
    I love the smell of pastures in the morning... /tell ahbeyra moo
      A small wonder, if the file you try to open isn't there. The file can't be opened, and the die part is executed. Check out Albannach's post, and learn about the file test operator: -f $file.