[fpc-devel] does fpc lock the fpc.cfg exclusive on windows?
Marco van de Voort
marcov at stack.nl
Sat Aug 28 12:25:27 CEST 2010
In our previous episode, Jonas Maebe said:
> > But *if* fpc does lock the fpc.cfg file exclusively ( for a very short
> > time only, e.g. just open+lock, read, close), then there is the slim
> > chance of a conflict, and this error could be explained.
> FPC opens it as a regular text file using a regular assign/reset. I don't
> think that will result in exclusive access. It also checks for its
> existence using sysutils.fileexists, but I doubt that one asks for
> exclusive access either.
Doesn't that depend on filemode? I see a lot of places in the compiler where
it is read/changed/preserved:
cstreams.pas: oldfilemode : byte;
cstreams.pas: filemode:=$40 or Mode;
None of them in options. So there could be something to it, specially since
it is so early in the startup.
I did a quick writeln(filemode) just before the config file was opened, and
it printed 2, read/write (the default.
More information about the fpc-devel