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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

get all files from a directory

Status
Not open for further replies.

Hannes214

IS-IT--Management
Jan 30, 2006
45
DE
Hi

I have to check all *.dbf-files from directory, but I don't know, how to get the name of all files in a directory...

Can someone help??

Hannes

IT-Management
( FoxPro-Newbi :eek:) )
 
Welcome to VFP. also try

GETFILE( "DBF" )

It pops opens a menu with a list to choose.

Jim Rumbaugh
 
Hannes,
I just added a Function VFP:-General Coding Issues FAQ -> Utilities & usefull functions area for you. Name is "DBF of Volumes/ Directories / Files"

After Tek-Tips approves the code and it is available to you.
Go do this. Cut the code from the Tek-tip FAQ Area

Start VFP
in the command window

Set Default to ? ( Select the directory you want the list of DBF's)
Modi comm dir_dbf (Paste code into program & save it)
=dir_dbf(.t. , .f. , .f. , "C:\")
use c:\files exclu
delete all for ".DBF" $ UPPER(NAME)=.f.
pack
browse

There is your list of only dbf files in the directory you wanted.

You can use the same function to get a list of directories
or a list of all the drive letters you have mapped on the computer.

if you call it as
=dir_dbf(.t. , .t. , .t., "C:\")
on C:\ there will be 3 files
FILES.DBF
DIRECTRY.DBF
DRIVES.DBF
they will hold the info you requested from the directory you were in.

Enjoy.



 
adir() seems to be the most convenient. you may append content of you array directly to a table and then navigate through
 
ok thx to all :eek:)

IT-Management
( FoxPro-Newbi :eek:) )
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top