Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

adir() is slow on network

Status
Not open for further replies.

newtofoxpro

Programmer
Sep 16, 2007
301
IN
HowManyDbf=adir(DbfList,"*.dbf")

Above code, if I run on local HDD the speed is good but on network very slow. Is thre any alternate code to list files & folders.

Thanks in advance.
 
If it is so much slower that you noticeing the difference, Then I would look at your network configuration.

David W. Grewe Dave
 
Thanks, I have solved my problem this way

set defa to c:\myapp
mseco=seco()
HowManyDbf=mdir("DbfList","*.dbf")
wait wind str(seco()-mseco,12,5)
set defa to z:\myapp && Network/Server drive
mseco=seco()
HowManyDbf=mdir("DbfList","*.dbf")
wait wind str(seco()-mseco,12,5)

FUNCTION mDIR
*************
parameter inArray, inflType

rele &inArray
public &inArray
TmpFIle =sys(5)+sys(3)+".TMP"
TTLFiles=0
DIME &inArray(1,5)
set cons off
DIR &inflType to &TmpFIle
errfile=fopen(TmpFIle)
do while !feof(errfile)
DA138PVI =allt(fgets(errfile))+" "
outstring=""
for cnt=1 to len(DA138PVI)
if subs(DA138PVI,cnt,1)#" "
outstring=outstring+subs(DA138PVI,cnt,1)
else
if file(outstring)
TTLFiles=TTLFiles+1
DIME &inArray(TTLFiles,5)
store outstring to &inArray(TTLFiles,1)
store 0 to &inArray(TTLFiles,2)
store fdate(outstring) to &inArray(TTLFiles,3)
store ftime(outstring) to &inArray(TTLFiles,4)
store "A" to &inArray(TTLFiles,5)
endif
outstring=""
endif
endfor
enddo
=fclose(errfile)
erase &TmpFIle
RETURN TTLFiles
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top