Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
File copy over Citrix - progress indicator
Message
De
31/08/2005 13:07:57
 
 
À
31/08/2005 12:06:34
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
Information générale
Forum:
Visual FoxPro
Catégorie:
Produits tierce partie
Divers
Thread ID:
01044624
Message ID:
01045564
Vues:
23
>>>>>>>>>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
:)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform