Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Slow detection of absent UNC
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Environment versions
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01269426
Message ID:
01269493
Views:
19
Not even this one speeds up here.

>Peter,
>
>If scripting is an option you might try GetFolder, in my test directory() takes between 5 and 10 seconds while getFolder takes just less than 0.02 seconds with the following code
>
>
>clear
>lcNotExistent		= '\\notexistent\notexistent\notexistent'
>lcExistent		= '\\skyapps\apps\foxv\training'
>
>lnStart			= Seconds()
>
>? lcNotExistent, Directory(lcNotExistent), Seconds() - lnStart
>
>
>lnStart			= Seconds()
>? lcExistent, Directory(lcExistent), Seconds() - lnStart
>
>lnStart			= Seconds()
>loFSO			= Createobject('Scripting.FileSystemObject')
>try
>	loFolder		= loFSO.getFolder(lcNotExistent)
>catch
>	loFolder		= null
>endtry
>
>? lcNotExistent, not Isnull(loFolder), Seconds() - lnStart
>
>lnStart			= Seconds()
>loFSO			= Createobject('Scripting.FileSystemObject')
>try
>	loFolder		= loFSO.getFolder(lcExistent)
>catch
>	loFolder		= null
>endtry
>
>? lcExistent, not Isnull(loFolder), Seconds() - lnStart
>
Groet,
Peter de Valença

Constructive frustration is the breeding ground of genius.
If there’s no willingness to moderate for the sake of good debate, then I have no willingness to debate at all.
Let's develop superb standards that will end the holy wars.
"There are three types of people: Alphas and Betas", said the beta decisively.
If you find this message rude or offensive or stupid, please take a step away from the keyboard and try to think calmly about an eventual a possible alternative explanation of my message.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform