Article View: de.comp.lang.perl
Article #13C open function in perl (lockfile)
From: Reiners Dirk
Date: Wed, 01 Nov 1995 00:00
Date: Wed, 01 Nov 1995 00:00
25 lines
1335 bytes
1335 bytes
Can I emulate/call the normal C open function in/from perl.
I want to translate the following code to perl:
st=open("foo",O_CREAT|O_EXCL,0777)
for writing a lockfile function (some machines here don't support flock :-(
I have already a solution like
syscall(&SYS_open, "foo", O_CREAT|O_EXCL, 0777);
but there seems to be no such function in sys/syscall.ph.
I don't know if this is normal.
(e.g.:
IRIX 5.3 no SYS_open in syscall.ph
SunOS 4.1.3 no syscall.ph at all
)
And I want the solution to work on both platform :-)
Does anyone have an idea ?
--
Andreas
http://www.igd.fhg.de/~pvr
------------------------------------------------
>>> This mail was written in 14 minutes and 36 seconds
Technical Details
Message-ID:
<4786us$a0f@korfu.igd.fhg.de>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1043e7,5ddc5a1c50ff66cd,start X-Google-Attributes: gid1043e7,public X-Google-Thread: fa0ae,5ddc5a1c50ff66cd,start X-Google-Attributes: gidfa0ae,public X-Google-Thread: 1133f4,5ddc5a1c50ff66cd,start X-Google-Attributes: gid1133f4,public From: pvr@korfu.igd.fhg.de (Reiners Dirk) Subject: C open function in perl (lockfile) Date: 1995/11/01 Message-ID: <4786us$a0f@korfu.igd.fhg.de> X-Deja-AN: 118463855 organization: Fraunhofer Inst. for Computer Graphics, Darmstadt, Germany newsgroups: de.comp.lang.perl,fj.lang.perl,comp.lang.perl.misc