|FROM ||Ruben Safir
|SUBJECT ||Subject: [NYLXS - HANGOUT] (fwd) Re: C++ File Lokcing
|From owner-hangout-outgoing-at-mrbrklyn.com Tue Jun 7 14:56:03 2011
Received: by www2.mrbrklyn.com (Postfix)
id 83B4B100B50; Tue, 7 Jun 2011 14:56:02 -0400 (EDT)
Received: by www2.mrbrklyn.com (Postfix, from userid 28)
id 333D7100B42; Tue, 7 Jun 2011 14:56:01 -0400 (EDT)
Received: from mailbackend.panix.com (mailbackend.panix.com [188.8.131.52])
by www2.mrbrklyn.com (Postfix) with ESMTP id E8E3C100B3D
for ; Tue, 7 Jun 2011 14:55:59 -0400 (EDT)
Received: from panix2.panix.com (panix2.panix.com [184.108.40.206])
by mailbackend.panix.com (Postfix) with ESMTP id 0B893329E9
for ; Tue, 7 Jun 2011 14:56:25 -0400 (EDT)
Received: by panix2.panix.com (Postfix, from userid 20529)
id 0AF6E33C1F; Tue, 7 Jun 2011 14:56:25 -0400 (EDT)
From: Ruben Safir
Subject: [NYLXS - HANGOUT] (fwd) Re: C++ File Lokcing
User-Agent: tin/1.8.3-20070201 ("Scotasay") (UNIX) (NetBSD/5.1 (i386))
Date: Tue, 7 Jun 2011 14:56:24 -0400 (EDT)
-- forwarded message --
From: Ruben Safir
Subject: Re: C++ File Lokcing
Date: Tue, 7 Jun 2011 18:17:03 +0000 (UTC)
Organization: PANIX Public Access Internet and UNIX, NYC
Content-Type: text/plain; charset=UTF-8
X-Trace: reader1.panix.com 1307470623 28210 220.127.116.11 (7 Jun 2011 18:17:03 GMT)
NNTP-Posting-Date: Tue, 7 Jun 2011 18:17:03 +0000 (UTC)
X-Blackjet: Blackjet is a Yankee Fan
X-DRMisTHEFT: Use GNU Linux today
X-From: A Dark Cloud
X-LOCATION: Brooklyn NY - Forget abou' it!
X-NYLXS: Really - yah think computers are supposed to be broken?
User-Agent: Pan/0.133 (House of Butterflies)
Xref: panix comp.lang.c++:1086199
On Tue, 07 Jun 2011 11:55:36 -0400, Victor Bazarov wrote:
> On 6/7/2011 11:54 AM, ruben safir wrote:
>> On 06/07/2011 02:33 AM, Stefan Ram wrote:
>>> "osmium" writes:
>>>> "ruben safir" wrote:
>>>>> Is there a C++ specific means of file locking?
>>>> No. File locking is provided by the operating system, not an ordinary
>>>> program, which is what a C++ compiler produces.
>>> This must be the correct answer, because Linus Torvalds also says that
>>> a C++ compiler cannot produce an operating system!
>>> (The real reason is - of coures - just that the C++ standard library
>>> does not provide this feature, but this might change in the future.)
>> I have to do file locking on Linux. Do you have a recommendation?
> How about news:comp.os.linux.development.apps ?
But Victor, if you can't file lock with posix file locking, then there is
almost no use of ios_base for file systems. You have to lock files on a
multiuser OS before you write to them. Can you get the file descriptor
from ofsream or can you feed flock()?
-- end of forwarded message --