Files.FileExists
----------------

Checks whether a file exists with the given path.

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

MBS( "Files.FileExists"; Path ) 

**MBS**( **"Files.FileExists";** /\* Checks whether a file exists with the given path. \*/  
**$Path**) /\* Native path to the file to check.e.g. "C:\\Windows" \*/ 

### 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](FilesItemExists.md) returns 1. If it's a directory, [Files.DirectoryExists](FilesDirectoryExists.md) also returns 1 and Files.FileExists returns 0. With a file, Files.FileExists returns 1 and [Files.DirectoryExists](FilesDirectoryExists.md) returns 0.  
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.  
  
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](ProcessSetCurrentDirectory.md)"; "C:\\Program Files (x86)\\FileMaker\\FileMaker Pro 18 Advanced/Extensions") &amp;   
MBS ( "Files.FileExists"; "../Extensions/MBS .fmx")  
### See also

- [CURL.SetOptionCAInfo](CURLSetOptionCAInfo.md)
- [DragDrop.GetPath](DragDropGetPath.md)
- [DragDrop.GetPathCount](DragDropGetPathCount.md)
- [Files.ItemExists](FilesItemExists.md)
- [Path.FileMakerPathToNativePath](PathFileMakerPathToNativePath.md)
- [Process.SetCurrentDirectory](ProcessSetCurrentDirectory.md)
- [Schedule.EvaluateAfterDelay](ScheduleEvaluateAfterDelay.md)
- [WIA.Image](WIAImage.md)
- [WIA.ImageCount](WIAImageCount.md)
- [WinPhotoAcquire.Files](WinPhotoAcquireFiles.md)

### Example Databases

- [Drag and Drop/DragTest Popover](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Drag%20and%20Drop/DragTest%20Popover.shtml#3ScriptAnchor_)
- [Drag and Drop/DragTest](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Drag%20and%20Drop/DragTest.shtml#3ScriptAnchor_)
- [Drag and Drop/for Mac/DragTest multiple picture files](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Drag%20and%20Drop/for%20Mac/DragTest%20multiple%20picture%20files.shtml#3ScriptAnchor_)
- [Files/File Exists](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Files/File%20Exists.shtml#1ScriptAnchor_)
- [Mac and iOS/PDFKit/PDF Merge Shrink Tool](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Mac%20and%20iOS/PDFKit/PDF%20Merge%20Shrink%20Tool.shtml#3ScriptAnchor_)
- [OCR/OCR with DynaPDF](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/OCR/OCR%20with%20DynaPDF.shtml#5ScriptAnchor_)
- [Saxon/Saxon ZUGFeRD Validation](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Saxon/Saxon%20ZUGFeRD%20Validation.shtml#1ScriptAnchor_)
- [WebViewer/WebViewer Save PDF](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/WebViewer/WebViewer%20Save%20PDF.shtml#3ScriptAnchor_)
- [Win Only/PhotoAcquire](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Win%20Only/PhotoAcquire.shtml#7ScriptAnchor_)
- [Win Only/Scanning/WIA Scan](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Win%20Only/Scanning/WIA%20Scan.shtml#9ScriptAnchor_)

### Blog Entries

- [Validate electronic invoices with Saxon](https://www.mbsplugins.de/archive/2026-03-20/Validate_electronic_invoices_w/monkeybreadsoftware_blog_filemaker)
- [Validate electronic invoices with Saxon](https://www.mbsplugins.de/archive/2025-02-18/Validate_electronic_invoices_w/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Advent calendar - Door 3 - Drag &amp; Drop](https://www.mbsplugins.de/archive/2024-12-03/MBS_FileMaker_Advent_calendar_/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 Plugin Advent calendar: 3 - BinaryFile](https://www.mbsplugins.de/archive/2023-12-03/MBS_Plugin_Advent_calendar_3_-/monkeybreadsoftware_blog_filemaker)
- [FileMaker 18 File Script Steps vs. BinaryFile functions](https://www.mbsplugins.de/archive/2019-06-03/FileMaker_18_File_Script_Steps/monkeybreadsoftware_blog_filemaker)
- [Use root certificates included with FileMaker](https://www.mbsplugins.de/archive/2018-11-05/Use_root_certificates_included/monkeybreadsoftware_blog_filemaker)
- [Adding Drag and Drop receiver to a layout](https://www.mbsplugins.de/archive/2018-10-08/Adding_Drag_and_Drop_receiver_/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 2.7fc](https://www.mbsplugins.de/archive/2012-05-08/MBS_Filemaker_Plugin_version_2/monkeybreadsoftware_blog_filemaker)

### FileMaker Magazin

- [Ausgabe 4/2025, Seite 31 bis 32](https://filemaker-magazin.de/neuigkeit/4297-Appetithappen-FMM_202504)
- [Ausgabe 6/2024, Seite 37](https://filemaker-magazin.de/neuigkeit/4277-Appetithappen-FMM_202406)
- [Ausgabe 4/2020, Seite 34](https://filemaker-magazin.de/neuigkeit/4103-Appetithappen-FMM_202004)

This function checks for a license.

Created 18th August 2014 , last changed 10th August 2020

  
[Files.FileDisplayName](FilesFileDisplayName.md) - [Files.FileExtension](FilesFileExtension.md)

[HTML Version](FilesFileExists.shtml)