Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
File copy over Citrix - progress indicator
Message
From
31/08/2005 12:06:34
Dragan Nedeljkovich
Now officially retired
Zrenjanin, Serbia
 
 
To
31/08/2005 10:03:04
General information
Forum:
Visual FoxPro
Category:
Third party products
Miscellaneous
Thread ID:
01044624
Message ID:
01045536
Views:
30
>>>>>>>>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)
>>*-- 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)
>
Beg your pardon? ... seems to be you were too fast with the response

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform