Components | All | New | MacOS | Windows | Linux | iOS | ||||
Examples | Mac & Win | Server | Client | Guides | Statistic | FMM | Blog | Deprecated | Old |
Files.ListRecursive
Queries list of paths in folder.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
Files | 4.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
MBS( "Files.ListRecursive"; Path { ; filter; Timeout } ) More
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 1 for showing only files, 2 for showing only directories and 4 for showing only visible files. Add 16 to include package file content on Mac. Add 32 to treat packages as files. In v7.3 you can add 64 to not list content of invisible directories. |
5 | Optional |
Timeout | the timeout in seconds. Default is 5. | 5.0 | Optional |
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 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.
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 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)
See also
Release notes
- Version 8.4
- Changed Files.ListRecursive to use either / or \ for path delimiter on Windows.
- Version 7.3
- Added new flag for Files.ListRecursive to ignore invisible folders and better check for hidden elements.
- Version 7.1
- Improved error handling for Files.ListRecursive.
Example Databases
Blog Entries
- MBS Plugin Advent calendar: 12 - Files
- MBS FileMaker Plugin, version 10.5pr7
- New in the MBS FileMaker Plugin 10.0
- MBS FileMaker Plugin, version 8.4pr10
- Comparing Base Elements Plugin to MBS FileMaker Plugin
- MBS FileMaker Plugin, version 7.3pr2
- MBS FileMaker Plugin, version 7.1pr4
- MBS FileMaker Plugin, version 6.4pr4
- MBS FileMaker Plugin, version 6.2pr9
- MBS FileMaker Plugin 4.1 for OS X/Windows - More than 2400 Functions In One Plugin
FileMaker Magazin
This function checks for a license.
Created 18th August 2014, last changed 1st July 2022