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:
11.0
11.1
11.2
11.3
11.4
11.5
12.0
12.1
12.2
12.3
Statistic
FMM
Blog
Files.FileExists
Checks whether a file exists with the given path.
Component | Version | macOS | Windows | Linux | Server | iOS SDK | License |
Files | 2.7 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | Paid |
Parameters
Parameter | Description | Example |
---|---|---|
Path | Native path to the file to check. | "C:\Windows" |
Result
Returns 1 if file exists and 0 if not.
Description
Checks whether a file exists with the given path.If item exists at the path Files.ItemExists returns 1. If it's a directory, Files.DirectoryExists also returns 1 and Files.FileExists returns 0. With a file, Files.FileExists returns 1 and Files.DirectoryExists returns 0.
This function needs a native path. Please use Path.FileMakerPathToNativePath function in order to convert a FileMaker style path to a native path.
For applications on macOS, this function returns 0 as those are directories.
Examples
Checks whether file exists:
Set Variable [$r; Value:MBS( "Files.FileExists"; "/Users/cs/Desktop/test.rtf")]
Test relative folder path by passing relativre path after setting starting folder:
MBS("Process.SetCurrentDirectory"; "C:\Program Files (x86)\FileMaker\FileMaker Pro 18 Advanced/Extensions") &
MBS( "Files.FileExists"; "../Extensions/MBS.fmx")
See also
- CURL.SetOptionCAInfo
- DragDrop.GetPath
- DragDrop.GetPathCount
- Files.DirectoryExists
- Files.ItemExists
- Path.FileMakerPathToNativePath
- Process.SetCurrentDirectory
- WIA.Image
- WIA.ImageCount
- WinPhotoAcquire.Files
Example Databases
- CURL/Amazon S3 Upload File
- CURL/CURL with certificates included with FileMaker
- Drag and Drop/DragTest Popover
- Drag and Drop/DragTest
- Drag and Drop/for Mac/DragTest multiple picture files
- Files/File Exists
- OCR/OCR with DynaPDF
- OCR/OCR
- Win Only/PhotoAcquire
- Win Only/WIA Scan
Blog Entries
- Use root certificates included with FileMaker
- Adding Drag and Drop receiver to a layout
- MBS Filemaker Plugin, version 4.1pr3
- MBS Filemaker Plugin 2.7 Release notes
- MBS Filemaker Plugin, version 2.7pr2
FileMaker Magazin
Created 18th August 2014, last changed 10th August 2020
Files.FileDisplayName - Files.FileExtension
Feedback: Report problem or ask question.
