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

Detecting folders

Status
Not open for further replies.

CleoMan

Programmer
Jun 18, 2003
110
ZA
I know this might be a stupid question, but none the less.

I have a folder called "TABLES", this folder can contain a random number of folders, where each folder will have a nr of tables in the folder.

What I want to do is create a table that lists all the folders with their full paths of the folders in the "TABLES" folder.

AKA. A table with a list of folders in my TABLES directory.

I hope that makes sense ;-)

Thanks in advance
Richard
 
It may seem convoluted, but since directory names can contain all kinds of stuff you pretty much have to test every name in the directory to see if it is a file or subdirectory.

You'll likely want to change the enumfilelist to include the full path to TABLES directory. But hopefully the below can help get you started.

var
fs filesystem
ar,
arDir array[] string
endvar

fs.enumfilelist("*.*",ar)

for i from 1 to ar.size()
if (ar="." or ar="..") then loop endif
if isdir(ar) then
arDir.addlast(ar)
endif
endfor



arDir.view()


Tony McGuire
 
Thanks for the reply Tony. I'll be trying it out today and let you know if it worked.

Thanks again
Richard
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Sponsor

Back
Top