in reply to Re^2: Can I include O_CREAT, O_EXCEL and O_WRONLY in my script without always requiring Fcntl?
in thread Can I include O_CREAT, O_EXCEL and O_WRONLY in my script without always requiring Fcntl?
sub openit { require Fcntl; my $fp = "c:\\temp\\test.csv.lck.tmp"; die "Unable to open $fp" if !sysopen (my $fh, $fp, Fcntl::O_WRONLY() + | Fcntl::O_CREAT() | Fcntl::O_EXCL()); close $fh; unlink $fp; return $fp; }
|
|---|