Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ADIR( ) doesn't work
Message
De
04/09/2001 07:28:03
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
03/09/2001 23:37:38
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00551926
Message ID:
00551983
Vues:
15
>Dear All,
>
>I'd like to get information about sub directory within directory using ADIR() but it doesn't work.
>
>eg.
>c:\Datas\data1\*.log
>c:\Datas\data2\*.log
>c:\Datas\data3\*.log
>c:\Datas\data4\*.log
>
>TData=ADIR(Tcount,'c:\datas\*.*') ---> TData return 0
>
>Did I miss something here ?
>
>
>Tia,
>Andreas.

Andreas,
First collect the directories than loop to collect files in them.
GetDirs('c:\Datas')
select DirList
scan
 lnFiles = adir(arrFiles,trim(Dirname)+'*.*')
 for ix = 1 to lnFiles
 *do whatever
 endfor
endscan

function GetDirs
lparameters tcPath
local lcTopDir
lcTopDir = sys(5)+curdir()
create cursor dirlist (dirname c(127))
=getsubdirs(tcPath)
set default to (lcTopDir)
browse

function getsubdirs
lparameters tcPath
local lcCurDir, lnSubDirs, ix
local array laDirs[1]
set default to (tcPath)
lcCurDir = sys(5)+curdir()
lnSubdirs=adir(laDirs,"","D")
insert into dirlist values (lcCurDir)
for ix = 1 to lnSubDirs
    if laDirs[ix,1]#"."
       	=getsubdirs(laDirs[ix,1])
		set defa to (lcCurDir)
    endif
endfor
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform