Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Why FCreate() + FPuts() + FCLose()... take so long time
Message
De
19/08/2006 09:33:37
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
19/08/2006 08:47:49
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01146992
Message ID:
01147002
Vues:
13
>My code is as simple as that...
>
>nHandle = FCreate("MyFilePlacedOnNetWork")
>If nHandle > 0
> = FPuts(nHandle, "AStringOfApprox100Characters")
> = FClose(nHandle)
>Endif
>
>After the FClose() command, I am watching the Explorer window and the file is very long (about 5 secondes) to appear. Is it normal it take so long time? Is it because the Network ou Windows itself? Someone can explain to me the process?

I think it is a matter of Windows Explorer refreshing, nothing to do with Visual FoxPro. To test this, check the time it takes Visual FoxPro, within Visual FoxPro, for example:
lnStartTime = seconds()
nHandle = FCreate("MyFilePlacedOnNetWork")
If nHandle > 0
   = FPuts(nHandle, "AStringOfApprox100Characters")
   = FClose(nHandle)
Endif
? seconds() - lnStartTime
I sometimes had problems with Windows Explorer taking a LONG time for simple things. You might consider using alternative programs, like Windows Commander, but I don't know if they work any faster in this case - the problem might be in the underlying file handling, done by Windows.

>P.S.: I have to use FCreate()... instead StrToFile() function because I put this code in a Foxpro-Dos compiled program. Don't laugh, I know... :-)

For older versions - before VFP 6 - I suggest you create (or check the download section for) StrToFile() and FileToStr(). They are very useful. Of course, the UDFs would use LLFF.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform