Files.ListRecursive
-------------------

Queries list of paths in folder.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [Files](component_Files.md) | [4.1](newinversion41.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "Files.ListRecursive"; Path { ; Filter; TimeOut; ExtensionFilter } ) 

**MBS**( **"Files.ListRecursive";** /\* Queries list of paths in folder. \*/  
**$Path**; /\* Native path to the directory.e.g. "C:\\Test\\" \*/   
**$Filter**; /\* Optional; Optional, limits what is returned. Default is 0 to report all files.   
  
Pass a combination of the following values:  
1 for showing only files,   
2 for showing only directories and   
4 for showing only visible files.   
16 to include package file content on Mac.   
32 to treat packages as files.  
64 to not list content of invisible directories.  
128 to use the extension filter text and do a substring match on the file name.e.g. 5 \*/   
**$TimeOut**; /\* Optional; the timeout in seconds. Default is 5.e.g. 5.0 \*/   
**$ExtensionFilter**) /\* Optional; Optional, a filter for getting only files with matching file extension.  
Since version 16.1 this can be a list.e.g. ".txt¶.rtf" \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| Path | Native path to the directory. | "C:\\Test\\" |  |
| Filter | Optional, limits what is returned. Default is 0 to report all files.       Pass a combination of the following values:   1 for showing only files,    2 for showing only directories and    4 for showing only visible files.    16 to include package file content on Mac.    32 to treat packages as files.   64 to not list content of invisible directories.   128 to use the extension filter text and do a substring match on the file name. | 5 | Optional |
| TimeOut | the timeout in seconds. Default is 5. | 5.0 | Optional |
| ExtensionFilter | Optional, a filter for getting only files with matching file extension.   Since version 16.1 this can be a list. | ".txt¶.rtf" | Optional      Added in version **15.2**. |

### Result

Returns list of files separated by return.

### Description

Queries list of paths in folder.  
This function is recursive and will look in all subfolders. Due to very large file systems you can pass a timeout. Default is 5 seconds. FileMaker will not respond to user input while the query runs.  
The list of names is separated by new line character.  
This function needs a native path. Please use [Path.FileMakerPathToNativePath](PathFileMakerPathToNativePath.md) function in order to convert a FileMaker style path to a native path.  
You can decide on Mac on whether files inside a package (e.g. application) are listed or not. By default we ignore those files, but you can include package content with adding 16 to the filter parameter.  
  
See also [Files.List](FilesList.md).  
  
If input path ends with / on Windows, we use slash for adding path components in v8.4 or newer. Otherwise we use the default on Windows, which is a backslash.  
  
You can filter by file extensions when doing the list and then filter with [List.MatchesPostfix](ListMatchesPostfix.md) function.  
### Examples

Queries files in download folder on Mac:

 MBS ("Files.ListRecursive"; "/Users/cs/Downloads")  
Queries visible files in my user folder, limit for 10 seconds:

 MBS ("Files.ListRecursive"; "c:\\\\Users\\\\Christian"; 5; 10)  
List only visible files in visible directories:

 MBS ( "Files.ListRecursive"; "/Users/shared"; 64+4)  
Find files containing "runtime"in the name within a folder:

 MBS ("Files.ListRecursive"; "C:\\Program Files\\Test"; 128; 5; "runtime")  
Find all MP3 and MP4 files in the music folder:

 MBS ("Files.ListRecursive"; MBS ("[Folders.UserMusic](FoldersUserMusic.md)"); 4; 10; ".mp3¶.mp4")  
### See also

- [Files.List](FilesList.md)
- [Folders.UserMusic](FoldersUserMusic.md)
- [List.MatchesPostfix](ListMatchesPostfix.md)
- [List.RemovePrefix](ListRemovePrefix.md)
- [Path.FileMakerPathToNativePath](PathFileMakerPathToNativePath.md)

### Release notes

- **Version 16.1**
    - Changed [Files.List](https://www.mbsplugins.eu/FilesList.shtml), [Files.ListAsJSON](https://www.mbsplugins.eu/FilesListAsJSON.shtml) and [Files.ListRecursive](https://www.mbsplugins.eu/FilesListRecursive.shtml) to accept a list for ExtensionFilter parameter.
- **Version 15.2**
    - Added ExtensionFilter parameter to [Files.ListRecursive](https://www.mbsplugins.eu/FilesListRecursive.shtml) function.
    - Added flag 128 for matching substring with the ExtensionFilter parameter for the [Files.List](https://www.mbsplugins.eu/FilesList.shtml), [Files.ListAsJSON](https://www.mbsplugins.eu/FilesListAsJSON.shtml) and [Files.ListRecursive](https://www.mbsplugins.eu/FilesListRecursive.shtml) functions.
- **Version 8.4**
    - Changed [Files.ListRecursive](http://www.mbsplugins.eu/FilesListRecursive.shtml) to use either / or \\ for path delimiter on Windows.
- **Version 7.3**
    - Added new flag for [Files.ListRecursive](http://www.mbsplugins.eu/FilesListRecursive.shtml) to ignore invisible folders and better check for hidden elements.
- **Version 7.1**
    - Improved error handling for [Files.ListRecursive](http://www.mbsplugins.eu/FilesListRecursive.shtml).

### Example Databases

- [Files/File listing recursive](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Files/File%20listing%20recursive.shtml#1ScriptAnchor_)

### Blog Entries

- [MBS FileMaker Plugin, version 16.1pr5](https://www.mbsplugins.de/archive/2026-03-01/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [MBS Plugin 15.2 for Claris FileMaker](https://www.mbsplugins.de/archive/2025-05-06/MBS_Plugin_152_for_Claris_File/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 15.2pr1](https://www.mbsplugins.de/archive/2025-04-01/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [MBS Plugin Advent calendar: 12 - Files](https://www.mbsplugins.de/archive/2023-12-12/MBS_Plugin_Advent_calendar_12_/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 10.5pr7](https://www.mbsplugins.de/archive/2020-11-02/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [New in the MBS FileMaker Plugin 10.0](https://www.mbsplugins.de/archive/2020-01-23/New_in_the_MBS_FileMaker_Plugi/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 8.4pr10](https://www.mbsplugins.de/archive/2018-09-21/MBS_FileMaker_Plugin_version_8/monkeybreadsoftware_blog_filemaker)
- [Comparing Base Elements Plugin to MBS FileMaker Plugin](https://www.mbsplugins.de/archive/2017-10-24/Comparing_Base_Elements_Plugin/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 7.3pr2](https://www.mbsplugins.de/archive/2017-06-09/MBS_FileMaker_Plugin_version_7/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin 4.1 for OS X/Windows - More than 2400 Functions In One Plugin](https://www.mbsplugins.de/archive/2014-03-18/MBS_FileMaker_Plugin_41_for_OS/monkeybreadsoftware_blog_filemaker)

### FileMaker Magazin

- [Ausgabe 4/2020, Seite 34](https://filemaker-magazin.de/neuigkeit/4103-Appetithappen-FMM_202004)
- [Ausgabe 2/2017, Seite 39](https://filemaker-magazin.de/neuigkeit/3930-Appetithappen-FMM_201702)

This function checks for a license.

Created 18th August 2014 , last changed 24th February 2026

  
[Files.ListOpenFiles](FilesListOpenFiles.md) - [Files.ListVolumes](FilesListVolumes.md)

[HTML Version](FilesListRecursive.shtml)