--- title: "system.file.fileExists" description: "Checks to see if a file or folder at a given path exists." --- # system.file.fileExists > Checks to see if a file or folder at a given path exists. This function is used in **Python Scripting**. ## Description ## Client Permission Restrictions This scripting function has no [Client Permission](projects\project-properties\project-properties.md#client---permissions) restrictions. ## Syntax `system.file.fileExists(filepath)` ### Parameters | Type | Parameter | Description | |---|---|---| | String | `filepath` | The path of the file or folder to check. | ### Returns **boolean** - True (1) if the file/folder exists, false (0) otherwise. ### Scope All ## Code Examples ```python title="Example #1" # This basic example shows how the fileExists function is used in its simplest form: if system.file.fileExists("C:\\temp_file.txt"): system.gui.messageBox("Yes, the file exists") else: system.gui.messageBox("No, it doesn't exist") ``` ```python title="Example #2" # This code uses the fileExists function, along with other system.file.* functions, to prompt the user to confirm that they want to overwrite an existing file. filename = system.file.saveFile(name) if filename != None: reallyWrite = 1 if system.file.fileExists(filename): overwriteMessage = "File '%s' already exists. Overwrite?" reallyWrite = system.gui.confirm(overwriteMessage % filename) if reallyWrite: system.file.writeFile(filename, "This will be the contents of my new file") ```