>>>>>>Is there any setting to have this deferred writing turned off, or should I just close and reopen the target file every now and then?
>>>>>
>>>>>Uses you a buffered file ?
>>>>
>>>>Mmm... good idea. The source file is buffered. Didn't find any parameters in the fCreate() command that would influence any buffering, but then I could close it immediately after and do a fopen(cTargetFile, 11) (unbuffered, write-only). I'll see what this gives me.
>>>
>>>Dragan, Don't forget to post the result to me.
>>
>>fFlush() wasn't even necessary... your idea to use unbuffered LL file operation was exactly what I needed. Works perfect.
>
>Well Dragan, was what I wanted to feel.
>
>Certainly that an enigma remains to understand because
>FCREATE() doesn't allow to disable the OS buffering.
Here's what I did - fcreate()d it, then closed and opened write-only without buffering:
Procedure DoCopy(tcF1, tcF2)
Local c, o, N, i, l, cCRS, h1, h2, nSoFar, nChunk
h1=Fopen(tcF1,10)
h2=Fcreate(tcF2)
=fclose(h2)
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,c)
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)