how to open a file with 666 permission

From: Arjun Mallik (arjun.mallik_at_wipro.com)
Date: 09/29/04


Date: Wed, 29 Sep 2004 12:49:59 +0530
To: <beginners@perl.org>

Hai!
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
==========================

Arjun


Confidentiality Notice

The information contained in this electronic message and any attachments to this message are intended
for the exclusive use of the addressee(s) and may contain confidential or privileged information. If
you are not the intended recipient, please notify the sender at Wipro or Mailadmin@wipro.com immediately
and destroy all copies of this message and any attachments.