Skip to content

File Read

Reads a file from the filesystem as a data stream.

This node reads a file from a specified path and provides its content as a data stream.

How it works#

  • It attempts to open the resource at the given path.
  • If the path points to a file and can be opened, the node provides the file's content on the data output stream and triggers the Success execution path.
  • The exists output is true if a file or directory is found at the path, and false otherwise.
  • The Error execution path is triggered for any of the following reasons:
  • The file does not exist.
  • The process lacks permissions to read the file.
  • The path points to a directory instead of a file.

Note: The data output may be populated even if the Error path is triggered (e.g., if the path is a directory). It is safest to only use the data output when the Success path is taken.

Inputs#

Port Description
Exec
Executes the node.
Path
The path to the file to read.

Outputs#

Port Description
Success
Executes if the file is valid and ready to be streamed.
Error
Executes if an error occurs (e.g., file not found, is a directory).
Exists
True if a file or directory exists at the path.
Data
A data stream of the file's content.

ID: core/file-read@v1