Read and process a list of file names

Verified
Added by iNTERFACEWARE

Use os.fs.glob() to return to process a list of filenames and statistics matching a specified pattern

Source Code
   -- Process a list of file names
   
   -- in this case we get all the log file names for Iguana
   for FileName, FileInfo in os.fs.glob('logs/*.log') do
      trace(FileName)
      trace(FileInfo)
      -- do some processing here
   end
Description
Use os.fs.glob() to return to process a list of filenames and statistics matching a specified pattern
Usage Details

Use os.fs.glob() to return an iterator for files that matches the specified pattern. The iterator returns  the name of each file and its os.fs.stat() table.

How to use the snippet:

  • Paste the code into your script