Topics
All
MacOS
(Only)
Windows
(Only)
Linux
(Only, Not)
iOS
(Only, Not)
Components
Crossplatform Mac & Win
Server
Client
Old
Deprecated
Guides
Examples
Videos
New in version:
9.5
10.0
10.1
10.2
10.3
10.4
10.5
11.0
11.1
11.2
Statistic
FMM
Blog
Files.List
Queries list of file names in folder.
Component | Version | macOS | Windows | Linux | Server | FileMaker iOS SDK |
Files | 2.8 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
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 items. Add 8 if the path includes the file name specification with wildcards. Combined pass 4+1 for visible files or 2+1 for visible directories. |
5 | Optional |
ExtensionFilter | Optional, a filter for getting only files with matching file extension. | ".txt" | Optional |
Result
Returns list of files separated by return.
Description
Queries list of file names in folder.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.
With filter parameter being 8 on Windows, you can pass a path with wildcards directly and ExtensionFilter parameter is ignored. This is not supported on macOS.
See also Files.ListRecursive. You can filter result with List.MatchesPostfix to get list with one file extension only.
If you need sorting, please check List.Sort function. Also use List.RemovePrefix or List.RemovePostfix to filter list further.
Examples
Queries files in Users folder on Mac:
$files = MBS("Files.List"; "/Users")
Queries visible files in windows folder:
$files = MBS("Files.List"; "c:\\Windows\\"; 5)
Queries DLL files in windows folder:
$files = MBS("Files.List"; "c:\\Windows\\"; 0; ".dll")
Queries Applications with name starting with e in windows folder:
$files = MBS("Files.List"; "c:\\Windows\\e*.exe"; 8)
Find FileMaker databases in a folder:
MBS("Files.List"; "c:\\Users\\Christian\\Desktop"; 0; ".fmp12")
See also
- Files.ListAsJSON
- Files.ListVolumes
- JSON.SortWithEvaluate
- List.Remove
- List.RemovePostfix
- List.RemovePrefix
- List.Sort
- Path.FileMakerPathToNativePath
- SyntaxColoring.AddContextMenuCommand
- ZipFile.CompressFiles
Release notes
- Version 10.5
- Added Files.ListAsJSON function to list files and return it as JSON.
- 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
- CURL/WebServices/WeatherBit.io test
- DynaPDF/DynaPDF Batch Preview
- Files/File Listing With Icons
- Files/File listing
- Mac and iOS/PDFKit/Pictures to PDF
- Mac only/Icon and QuickLook/QuickLook Preview Panel
- SQL in FileMaker/ImageGallery
Blog Entries
- Combined Components with MBS FileMaker Plugin
- Parsing VCard file
- Comparing Base Elements Plugin to MBS FileMaker Plugin
- MBS FileMaker Plugin, version 6.5pr1
- MBS FileMaker Plugin, version 6.4pr4
- MBS Filemaker Plugin, version 3.2pr2
- MBS Filemaker Plugin, version 3.1pr10
- MBS Filemaker Plugin, version 3.1pr4
- MBS FileMaker Plugin 2.8 for OS X/Windows - More than 1100 Functions In One Plugin
- MBS Filemaker Plugin, version 2.8pr2
FileMaker Magazin
Created 18th August 2014, last changed 1st March 2021
Files.LaunchFile - Files.ListAsJSON
Feedback: Report problem or ask question.

Links
MBS Xojo Plugins