/ lang / rdir
RDir
Syntax

    File name array = RDir ( Directory AS String [ , Pattern AS String , Filter AS Integer ] )

Returns a string array that contains the names of files located in Directory that matches the Pattern and the Filter.

The specified directory is recursed.

- The pattern can contain the same generic characters than the LIKE operator. If no pattern is specified, any file name is returned.

- The filter specifies what kind of files will be returned, by specifying one or a combination of the file type constants. If Filter is not specified, all files and directories are returned.

| The file paths returned are relative to the searched directory.

### Examples

    ' Print the png image files in a directory and its sub-directories

    SUB PrintDirectory(Directory AS String)

      DIM File AS String

      FOR EACH File IN RDir(Directory, "*.png")
        PRINT File
      NEXT

    END

### See also

File & Directory Functions