[fpc-pascal] Configuration file handling

Mark Morgan Lloyd markMLl.fpc-pascal at telemetry.co.uk
Sat Feb 16 09:05:01 CET 2013


Andrew Brunner wrote:
> On 02/15/2013 04:54 PM, Mark Morgan Lloyd wrote:
>> If multiple, related, programs running on unix (Linux, Solaris etc.) 
>> refer to the same configuration file accessed via a TIniFile, is there 
>> any recommended "good practice" to ensure that they don't try to 
>> update it simultaneously?
>>
>> In the case that I'm thinking of, I don't anticipate e.g. multiple 
>> logins trying to write setup information at the same time. The more 
>> risky case is if there are e.g. multiple daemons or apps trying to 
>> save state when a UPS signals imminent shutdown.
>>
> 
> I would not use INI if the systems are writing data.  While I've had 
> plenty of success reading INI files in parallel - I seem to recall that 
> the file is just streamed out without regard to which version is on 
> disk.  I think the file is completely refreshed.
> 
> I recommend using a DBMS system of some sort for read/write ops in 
> parallel.

Not data as such, but e.g. what windows are open. I definitely agree 
that data being processed should be in a competent database.

Things like database server name should obviously be saved as soon as 
they're established, i.e. not left until the program shuts down.

-- 
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]



More information about the fpc-pascal mailing list