|FROM ||Ruben Safir
|SUBJECT ||Subject: [NYLXS - HANGOUT] (fwd) Re: C++ File Lokcing
|-- forwarded message --
From: Juha Nieminen
Subject: Re: C++ File Lokcing
User-Agent: tin/1.9.3-20080506 ("Dalintober") (UNIX) (Linux/18.104.22.168-kapsi-grbfs+ (x86_64))
Date: 07 Jun 2011 06:25:47 GMT
Organization: NBL Networks Oy
X-Trace: 1307427947 news.nbl.fi 2829 22.214.171.124:37262
Xref: panix comp.lang.c++:1086160
> "ruben safir" wrote:
>> Is there a C++ specific means of file locking?
> No. File locking is provided by the operating system, not an ordinary user
> program, which is what a C++ compiler produces.
That answer makes no sense. There are tons of things that are provided
by the OS which a normal program can use, such as reading and writing
files, allocating memory, printing to stdout, etc.
The correct answer is: No, the C++ standard does not provide any
standard mechanism for file locking. For that you'll have to resort to
some external system-specific functions such as the ones provided by the
POSIX standard or your OS API.
-- end of forwarded message --