Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2008-09

Re: command-line+Carbon template

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Unknown author

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

Bill

Show quoted text 16 lines
------------------------------ 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

Reply by email

Jonas Maebe
to Unknown author
Show quoted text 9 lines
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.

Unless you can show the code, I can't say what the problem may be in that case.

Jonas

Reply by email