At 20:34 14/08/2006, you wrote:
Hi all,

an application writes a text file on disk (Windows) and my FPC
application opens it to process it. On some systems I open the file
faster than the OS has finished writing it. I then get an 'Unexpected
end of file'.

I would like to know if there is a way I can detect the file is finish
written on the disk; else should I simply trap the error and then
close/reopen if I get it?

I think the problem is with the write cache. The system don't write data to disk directly, but to a cache, and when it has time, it writes 'really' to the disk. Don't know on windows, but on unix system the system call is flush.

HTH
_________________________________________________________________
    To unsubscribe: mail [EMAIL PROTECTED] with
               "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to