Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problem Retrieve File List
Message
De
15/06/1999 10:41:03
 
 
À
10/06/1999 18:25:59
Ronald Suen
Epic Solutions Inc.
Edmonton, Alberta, Canada
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00228593
Message ID:
00229967
Vues:
18
Ronald...

You can pass a second parameter to ADIR that includes the directory whose files you want. For example:

lcSourcePath = Application.DefaultFilePath + "\Reports\Prgs\"
lcDestPath = ALLTRIM(THISFORM.txtM2MPath.Value) + "Reports\Prgs\"

lnFileCount = ADIR(laFiles, lcSourcePATH + "*.*")

You might want to also use the 3rd parameter to limit the items in laFiles to only files (excluding directories, etc.).

Scott


>Hi all,
>
>I want to retrieve a list of all the files in a subdirectory which will then be used as part of a copy routine. Unfortunately, I am unable to set the current directory to the subdirectory before retrieving the list. What I have happening instead is that the file list that is being retrieved is that of the project directory and not the subdirectory. Below is the code that I am using to do this. Help?
>
>lcSourcePath = Application.DefaultFilePath + "\Reports\Prgs\"
>lcDestPath = ALLTRIM(THISFORM.txtM2MPath.Value) + "Reports\Prgs\"
>
>SET PATH TO (lcSourcePath)
>
>lnFileCount = ADIR(laFiles)
>
>FOR lnLoopCount = 1 TO lnFileCount
> COPY FILE (lcSourcePath + laFiles[lnLoopCount,1]) TO (lcDestPath + laFiles[lnLoopCount,1])
>ENDFOR
>
>Thanks in advance,
Scott D. Grabo
Chief Information Officer
Occupational Health Group
First Advantage Corporation
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform