MESSAGE
DATE | 2011-06-26 |
FROM | Ruben Safir
|
SUBJECT | Subject: [NYLXS - HANGOUT] (fwd) Re: C++ file locking
|
-- forwarded message -- Path: reader1.panix.com!panix!newsfeed-00.mathworks.com!solaris.cc.vt.edu!news.vt.edu!news.glorb.com!npeer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post01.iad.highwinds-media.com!newsfe09.iad.POSTED!00000000!not-for-mail From: Lew Pitcher Subject: Re: C++ file locking Newsgroups: comp.os.linux.development.apps Reply-To: lew.pitcher-at-digitalfreehold.ca References: <16265495-eb93-4e2e-a46c-f16bb6b19d9e-at-b1g2000yql.googlegroups.com> Lines: 36 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Message-ID: <7LsIp.1886$x11.1481-at-newsfe09.iad> X-Complaints-To: abuse-at-UsenetServer.com NNTP-Posting-Date: Fri, 10 Jun 2011 17:45:39 UTC Date: Fri, 10 Jun 2011 13:45:39 -0400 Xref: panix comp.os.linux.development.apps:166505
On June 9, 2011 23:54, in comp.os.linux.development.apps, ruben-at-mrbrkly= n.com wrote:
> On Wed, 08 Jun 2011 01:37:38 -0700, Lukas 'Erdk' Redynk wrote: >=20 >> On Jun 7, 2:24=C2=A0pm, Ruben Safir wrote: >>> Is there any means to do file locking with C++? >>> >>> Ruben >>=20 >> You could try this: >> http://linux.die.net/man/3/lockf >> or >> http://www.manpagez.com/man/2/fcntl/ - especially F_GETLK and F_SETL= K >>=20 >> Erdk >=20 >=20 > Yes but these both require you to get a file descriptor from the open=
> call, effectively doing an end run around ios_base. Is there no pure= ly C+ > + mechanism of do this, or aquiring the file descriptor from iosteams= ?
Apparently, C++ does not include a standard mechanism for file locking.= If you want file locking in a C++ program, you either have to work with yo= ur compiler's non-standard extensions (apparently, some compilers have extended ios_base to include forms of file locking) or with your operat= ing system's native file locking facilities (which reside outside of the standard C++, and thus have non-standard requirements).
--=20 Lew Pitcher Master Codewright & JOAT-in-training | Registered Linux User #112576 Me: http://pitcher.digitalfreehold.ca/ | Just Linux: http://justlinux.c= a/ ---------- Slackware - Because I know what I'm doing. ----= --
-- end of forwarded message --
|
|