Darren, As others have said, PHP is not really the right tool for client side work even if the client machine is also the server. Having said that, the general style of task you are trying to achieve is frequently tackled by the use of Recursive functions - functions that call themselves from "within" themselves. This technique is not by any means limited to PHP, most languages can do it. In pseudocode it might look a bit like this
function brain_explode ($directoryname) do{ get a filename and size and type (from path $directoryname) if (the file type is of type directory) { brain_explode; // call "myself" again before I have finished THIS iteration } else { echo the filename and size } } until there are no more files to list end_of_function. "until there are no more files to list" might in your instance be "until the sought after pattern is found" I dubbed this function brain_explode, plagiarised from Dash`s earlier mail, because recursive functions, if let loose on really deep tree like structures of any type (directories, websites, relational databases, linked lists - whatever) can consume large amounts of memory. Every time they recurse (call themselves) a totally new environment and set of variables is created for another instance of the function to run in while the parent function (and IT`S parents/grandparents) are still running (of course). So a tree structure 5 levels deep will potentially trigger 5 instances of the function running at the same time. If large arrays are involved (such as SQL result sets) your brain could explode. Hope this helps ----- Original Message ----- From: "Darren Reynolds" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, November 22, 2002 5:35 AM Subject: [PHP-WIN] documentation questions > working on a little project for myself here that had some general questions > about since am just getting started on the planning phase. the first > function that i'm going to be working on will eventuall take user input in > the form of a directory path on the machine. what i need it to do then is > recursively scan each directory under the user specified directory and > generate an array containing that information (something along the lines > <drive>:\\<path_to_files>\<filenames>). the discs the program will be > scanning all have the exact same naming structure, so once the array for the > disc has been read i wanna scan each line and tell the program something > like "scan until you find this particular pattern of characters, then take > everything before that and move it into *this* variable. and so on and so > forth line by line until the entire array has been parsed. once i get that > taken care of i can then start to write the sql update statements to get > those variables put into the tables / etc i've made. > > what i'm hoping that someone could help me with was a pointer to some > documentation that might help me learn what i need to get this done. also, > if anyone can think of an easier way to accomplish what i've outlined i'm > definitely open to suggestions ... :) > > > -- > PHP Windows Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php