[fpc-pascal] Re: command-line+Carbon template

Jonas Maebe jonas.maebe at elis.ugent.be
Sun Sep 28 18:06:20 CEST 2008


On 28 Sep 2008, at 17:44, logrus at amberagents.com wrote:

> Be all that as it may, this whole Rube Goldberg runs great when  
> compiled
> under CodeWarrior using MPW file i/o routines. With FPC's Turbo  
> routines,
> I'm seeing some strange "race conditions" that lead me to believe  
> the FPC
> version of the program perhaps is not completely relinquishing its  
> hold on
> a file even after it's been flushed and closed.

When you call close() on a file, it will be flushed and closed  
immediately. From what you described, it seems more likely to me that  
the FPC code is probably opening and reading the file before the LISP  
code has finished writing it (and/or vice versa), because FPC's  
standard I/O routines do not try to acquire exclusive access files  
(regardless of whether you open them for reading and/or writing).

The Carbon routines probably do check for exclusive access by default,  
so the LISP code will only open the file once the MW/FPC code is  
finished, and vice versa.


Jonas



More information about the fpc-pascal mailing list