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

logrus at amberagents.com logrus at amberagents.com
Tue Sep 30 21:54:30 CEST 2008

Thanks, Jonas --

Actually, I dealt with that potential source of anomalies way back in the
original CodeWarrior version: the Pascal code opens and writes out to the
file under a different name than the one the LISP code is looking for.
Only after the file's been written and closed is it renamed so LISP can
find, read, and (attempt to) delete it. The FPC version does the same
thing, yet the CW executable works and the FPC one doesn't. Go figure.

Falling back on the old Mac FileManager routines seems to have done the
trick, though


> ------------------------------
> 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