On 1/4/21 11:06 AM, Bart via fpc-pascal wrote:
On Mon, Jan 4, 2021 at 3:19 AM James Richters via fpc-pascal
<fpc-pascal@lists.freepascal.org> wrote:

I suspect that I happen to see the file is there and try to read it before the 
program that created the file is done writing it.
What is the proper way to detect the file is in use so I don't bother trying to 
open it until it's done being written?

Simple approach?
Use filemode = fmOpenRead and use a try..except block to open the file?
Opening will fail if the file is locked by another process (triggering
the exception).

provided the other program opens the file for creation properly (eg: blahDenyAll), right?


--
 NOTE: No off-list assistance is given without prior approval.
       *Please keep mailing list traffic on the list where it belongs!*
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to