[EMAIL PROTECTED] wrote:
Hai!

Hello,

My requirement is to open file with 666 permissions.[If fine doesn't
exists it should get created ].Iam doing as below,is this ok.

===========================
sysopen(LOG,"$main::TRACELOGFILE",O_CREATE,0666) or die "Can't open
trace file $main::TRACELOGFILE";
============================

ami doing any thing wrong ,if yes correct me.If file is created once it
is working fine.For the first time it is giving below error
===========================
Can't open trace file /var/opt/XXXXX/log/XXXXX08013.log
==========================

You should include the $! variable in your error message so you know *why* it failed. The third argument to sysopen must include *one* of either O_RDONLY or O_WRONLY or O_RDWR (read only OR write only OR read and write.)


Read the section "Open A la C" in perlopentut for more details on sysopen.

perldoc perlopentut



John
--
use Perl;
program
fulfillment

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to