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

Traversing a directory

Status
Not open for further replies.

justride

Programmer
Jan 9, 2004
251
US
Does anybody know how to traverse a specified folder for all subfolders and files, I am tryying to create a config file based on all files located within a specified folder.
Thanks
 
Have you looked at:

The [blue]glob()[/blue] function.
Or the [blue]opendir()[/blue] function.
and [blue]readdir()[/blue] function

You can Open the dir and go through the files using readdir adding them to an array if they are files, or checking if they are Directories and if they are, you go through those directories recursively.

To check you can use the [blue]isdir()[/blue] function.






.

----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top