🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

I need some tips of concurrent File access

#10139
From: Vladimir Stefanovic
Date: Tue, 18 May 2004 20:34
34 lines
1911 bytes
Hi,
There is a program installed (maybe a service)
that produces one ASCII log file per day. File
name is based on the date, eg: 040518.LOG
(18-may-2004).

The entries (writes) in the LOG file are very
frequent, so sometimes the file can have more
than 100000 entries (rows) per day.

The LOG file (which is currently being used by
the service for writing) CAN be opened for
reading by any other program (WordPad), ie I
want to say that a LOG is not opened for writing
in the Exclusive mode.


My questions are:

1) I want to montitor the LOG file entries (as
frequent as it is possible) and to perform some
action if I find something in the LOG. I can make
a service for that and that's not the problem.

I wonder how dangerous is that concurrent way of
accessing the LOG? I'm afraid that some entries
could fail to be written because I alredy opened
the LOG for reading. LOG can be up to 5MB sometimes.

2) Is there any better technique that I don't know
for the safe accessing that LOG contents?

Best regards,
Vladimir Stefanovic
Technical Details
Message-ID: <40aa7528@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!controlnews3.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.frii.net!newsfeed.frii.net!news.compaq.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,e86cfec8dc9314b5,start
X-Google-Attributes: gid10cc67,public
From: "Vladimir Stefanovic" <antivari@ptt.yu>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: I need some tips of concurrent File access
Date: Tue, 18 May 2004 22:34:56 +0200
Lines: 37
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2314.1300
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
NNTP-Posting-Host: 213.137.118.31
Message-ID: <40aa7528@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1084912936 213.137.118.31 (18 May 2004 13:42:16 -0700)
Path: arc1-ca.pugleaf.net!controlnews3.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.frii.net!newsfeed.frii.net!news.compaq.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail