🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #13390

Re: Multiple Threads & One Text File

#13390
From: Hans Galema
Date: Wed, 15 Oct 2003 06:48
18 lines
1769 bytes
Dennis Jones wrote:

> At first I thought specifying the appropriate file sharing modes would work,
> but then I realized that that would only work to block access to the file
> for other processes running on the SAME machine. 

Is that true ? Hard to believe. If you lock the file (and get the lock)
the access will to blocked by the os on the shared machine for others

> Any additional ideas would be welcome.

Isn't appending to a file with fwrite() an atomic process ?

Every client could open the file once for a whole session.
You do not have to lock. After fwrite() you could flush.
That would be all.

Hans.
Technical Details
Message-ID: <3f8ced2e@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!small1.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <3f88f22a@newsgroups.borland.com> <3f890078$1@newsgroups.borland.com> <3f8cc993$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,2cf03e35cbac1db7
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-10-14 23:59:08 PST
Date: Wed, 15 Oct 2003 08:48:57 +0200
From: Hans Galema <dontusethis@dontusethis.nl>
User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.3.1) Gecko/20030425
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Re: Multiple Threads & One Text File
References: <3f88f22a@newsgroups.borland.com> <3f890078$1@newsgroups.borland.com> <3f8cc993$1@newsgroups.borland.com>
In-Reply-To: <3f8cc993$1@newsgroups.borland.com>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 129.125.108.11
Message-ID: <3f8ced2e@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1066200366 129.125.108.11 (14 Oct 2003 23:46:06 -0700)
Lines: 19
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!small1.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail