API ReferenceGE Extensionsflowgraphnodesutil
File Exists (Flowgraph Node)
- **Node Name:** `File Exists`
Overview
- Node Name:
File Exists - Category:
once_p_duration - File:
extensions/flowgraph/nodes/util/fileExists.lua
Checks if a file exists and outputs both flow and boolean results.
Pin Schema
Input Pins
| Pin | Type | Description |
|---|---|---|
file | string | File path or name to check |
extension | string (hidden) | Optional extension appended to the file string |
Output Pins
| Pin | Type | Description |
|---|---|---|
exists | flow | Fires if the file exists |
missing | flow | Fires if the file does not exist |
existsBool | bool | Boolean reflecting file existence |
path | string | Resolved absolute file path |
Internals
Key Methods
| Method | Description |
|---|---|
workOnce() | Resolves the file path and checks existence via mgr:getRelativeAbsolutePath() |
How It Works
- Concatenates the
fileinput with the optionalextensioninput. - Calls
self.mgr:getRelativeAbsolutePath({fileName}, true)which resolves relative paths and checks existence. - Sets the
exists/missingflow pins, theexistsBoolboolean, and outputs the resolvedpath.
Usage Example
-- Check if a save file exists before loading:
-- [File Exists] file="savegame" extension=".json"
-- → exists → [Load Data]
-- → missing → [Create New Save]Key Dependencies
self.mgr:getRelativeAbsolutePath()- resolves and validates file paths within the flowgraph context
See Also
- Route Distance (Flowgraph Node) - Related reference
- Closest Road (Flowgraph Node) - Related reference
- Custom Lua (Flowgraph Node) - Related reference
- FlowGraph Guide - Guide