Procedure DoCopy(tcF1, tcF2) >*-- dn 26/08/05 > Local c, o, N, i, l, cCRS, h1, h2, nSoFar, nChunk > >*[2005/08/29 09:01:05] dragan - try without buffering, as Fabio suggested > h1=Fopen(tcF1,10) > h2=Fcreate(tcF2) > =fclose(h2) *This is the point where the code loses its safety, *for some microsecond you lose the control of the file * don't close and to use FFLUSH is disgusting but it resolves the problem > h2=fopen(tcF2,11) > > N=Fseek(h1,0,2) > Fseek(h1,0,0) > nSoFar=N/40 > nChunk=nSoFar > Do While !Feof(h1) >* c=Fread(h1, 0x7fff) > Fwrite(h2,Fread(h1, 0x7fff)) && why not this ? * > i=Fseek(h1,0,1) > If i>nSoFar > oLog.Log(Transform(i/N*100, "999.99%")+" copied") > nSoFar = nSoFar + nChunk > Endif > Enddo > Fclose(h1) > Fclose(h2)