File IO
Watch a file for changes, read its content as JSON, CSV, or text, and rename, copy, delete, or write files on a trigger.
What it does
File IO watches a file on disk and pulls its content into the graph. Point Path at a text, JSON or CSV file and it re-reads whenever the file changes on disk. JSON content can be narrowed with a JSONPath expression; CSV content can be split on a chosen delimiter and treated with or without a header row. Numbers found in the content come out as both a single first value and a full array, alongside the raw text, the file's basename, and its last-modified time.
The same node also pushes changes back out: switch on a write Operation (Rename, Copy, Delete, or Write Text) and fire Trigger to run it.
When to use it
A live value from disk (a config number, a status string, a JSON field) that updates whenever the source file is saved
Rows pulled out of a CSV file as numbers or text
A rename, copy, delete or text write run from the graph as an automation step
A hot-reloadable text or data source while iterating outside DNA
| Parameter | Type | Default |
|---|---|---|
path | String | "" |
parse_mode | String | "auto" |
json_path | String | "" |
csv_header | Boolean | true |
csv_delimiter | String | "comma" |
enabled | Boolean | true |
operation | String | "None" |
source_path | String | "" |
dest_path | String | "" |
write_content | Any | — |
trigger | Boolean | false |
Gotchas
Parse Mode only affects reading. JSON Path and the CSV options are ignored unless the file is parsed as JSON or CSV respectively. On "auto" the right one is detected from the file itself.
The write side (Operation, Source/Dest Path, Write Content, Trigger) is independent of the read side and does not use Path at all. Source Path doubles as the path to delete when Operation is Delete, and as the file to rename or copy from otherwise.
Trigger fires the write operation on a rising edge (off to on), so Operation and the paths can stay configured and be pulsed from a button or upstream logic without re-running every cook.
Turning Enabled off stops the file being watched. Content and the other read outputs stop updating rather than clearing.
Worked example
Add a File IO node and set Path to a JSON config file on disk.
Set Parse Mode to JSON and give Json Path a value like
$.data.valueto pull out just the field you need.Wire Content or Number downstream, then edit and save the file outside DNA and watch the graph update on the next cook.
To automate a file operation instead, set Operation to "Copy", fill in Source Path and Dest Path, and pulse Trigger from upstream logic.
See also
CSV Import · JSON Import · Export · Numbers, signals & audio