Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado
Re: Find files in windows, search subdirectories
In article <2a162acf.0411280932.4691e311@posting.google.com>, "Luciano" <luxx@softhome.net> wrote: > hi, > How do I find all the *.txt files, recursively inside all the > subddirectories from the path given ? In windows. I can only find them > for the base directory, using file_search, I cannot get it to search > inside subdirectories. The help on file_search sucks, I couldn't > descifer how to do it. I' m using idl 6.0, win xp. > thanks! Hi, Use the second form of file_search, i.e result=file_search(directory_specification, recursive_pattern) so, to find all *.txt files in the current directory and any sub-directories result=file_search('.', '*.txt') That's for Unix filesystems, you'll need to specify the directory properly for a Windows systems, I have no idea what '.' would translate to, possibly your home directory? use the full path 'c:\blah\'.... Chris.
Thank you very much Chris, that was easy! -- luciano. "Christopher Lee" <cl@127.0.0.1> schrieb im Newsbeitrag news:20041128.182743.1960709859.30829@moriarty.atm.ox.ac.uk. .. > In article <2a162acf.0411280932.4691e311@posting.google.com>, "Luciano" > <luxx@softhome.net> wrote: > > >> hi, >> How do I find all the *.txt files, recursively inside all the >> subddirectories from the path given ? In windows. I can only find them >> for the base directory, using file_search, I cannot get it to search >> inside subdirectories. The help on file_search sucks, I couldn't >> descifer how to do it. I' m using idl 6.0, win xp. >> thanks! > > Hi, > > Use the second form of file_search, i.e > > result=file_search(directory_specification, recursive_pattern) > > so, to find all *.txt files in the current directory and any > sub-directories > > result=file_search('.', '*.txt') > > That's for Unix filesystems, you'll need to specify the directory > properly for a Windows systems, I have no idea what '.' would translate > to, possibly your home directory? use the full path 'c:\blah\'.... > > Chris.