S�ren,
  To search for all files in a directory including subdirectories you
will need to do the following...

1a  Use FindFile routine to search for currentdir\*.

1b  Alternatively Use FindFile routine to search for currentdir\*.*
  Then do a IF stmt where VarOf_WIN32_FIND_DATA_type =16
  Where VarOf_WIN32_FIND_DATA_type is the data type structure of the WinAPI

Step 1 listed above will give you a list of directories

2  Store the results into a variable / textfile / temp table

3 Use a loop for the FindFile routine to search for founddir\*.
  Where founddir is a value or entry found from the previous results

4  Store the results into a variable / textfile / temp table

5  Repeat step 3 and 4 until no further results

6  Use a loop  for the FindFile routine to search for founddir\MyMapInfo.TAB
  Where founddir is a value or entry found from the final results
  and MyMapInfo.TAB is the file you are searching for.

I'd give you the code I made for my Resolve Workspace tool however I
cannot explain how I did it as looking back on it now I did something
wierd and funky.  Must be the optimizations I made that makes it
confusing =/

I would personally use a recursive function for this solution.

Note: beware of adding curent directory into results. Also beware not
to search on directories you have already searched on.

I hope the above was of help.

- Steve Chan

On Tue, 25 Jan 2005 13:31:07 +0100, S�ren Breddam <[EMAIL PROTECTED]> wrote:
> Hi,
> 
> Does anybody know how to search for files in a directory and all
> subdirectories with Mapbasic?
> I want to do some batch processing on all my tab-files, but I'm stuck. I can
> currently only search in one directory with FindFirstFile and
> FindNextFile...
> 
> TIA
> regards
> 
> S�ren Breddam
> GIS- og IT-koordinator
> Teknisk Forvaltning
> Stevns Kommune - www.stevns.dk
> *  Tlf.:  5656 1800
> *  Dir.:  5656 1891
> 
> ---------------------------------------------------------------------
> List hosting provided by Directions Magazine | www.directionsmag.com |
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> Message number: 14988
> 
>

---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 15073

Reply via email to