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

directery contents

Status
Not open for further replies.

spokex

Programmer
Jul 26, 2002
17
0
0
US
I have tried for some time to create a routine to retreive the contents of a directory, and put it into a table.
For example: all the *.jpg files in the c:\parts directory to be placed in the field of a table.

Any ideas are welcome.

Thanks,

Scott
 
use table && table you want to store filename in

path = "C:/parts/"
ofs = create('scripting.filesystemobject')
nfiles = ADIR(arr,path+"*.*")
FOR ii = 1 TO nfiles
x = ofs.getfile(path+arr[ii,1]).name
if upper(justext(x)) = 'JPG'
append blank
replace field with x
endif
NEXT

use
 
The ADIR() is what I was missing. This is the code I was using with about 50% success.

dir pichome + '*.jpg' to file c:\test && for pictures
create table c:\testx (fname c(50), B c(50))
append from c:\test type sdf

Thanks

Scott
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top