I came across an oddity in a program that creates lots (eg 30,000+) files 
exporting selected data from a database.

Some files disappear on slower PCs  even though they are created.
  a.. Files are created in a thread using TFilestream, in a loop 
  b.. Each file is being checked that it gets created using a if 
FileExists(filename) in the loop and they always seem to be there. 
  c.. Files are written at the rate of around 20-30 per second and are mostly 
around 3KB in size. 
  d.. At the end of the big loop a list of files created is created by the 
usual FindNext code. 
  e.. On some slower PC’s (XP or Server 2003) some files are missing.  Faster 
PC’s with Win7 have all the files.  All PC’s are VMs. 
  f.. Files missing might range from 10 to 500, never the same number 
  g.. The problem can be cured by putting a 2 millisecond sleep between 
creating each file.  1 Millisecond is not enough.
Can anyone shed any light on why this might be the underlying issue and why a 
sleep might fix it?

John Bird
_______________________________________________
NZ Borland Developers Group - Delphi mailing list
Post: [email protected]
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to [email protected] with 
Subject: unsubscribe

Reply via email to