Different pipes. One standard.

Type to search this site.

Search runs in your browser against a static index built with this site (Pagefind). Nothing you type is sent to a server.

ExtractExperimental

std:file-source #

Source: an NDJSON file. Needs a filesystem.read grant covering path.

For example: start a pipeline from an NDJSON file.

A pipe is a data processing step with declared inputs and outputs; standard pipes are built into the runner.

Ports #

std:file-source takes no inputs and produces out.std:file-sourceoutrecords
std:file-source takes no inputs and produces out.std:file-sourceoutrecords
Named ports from the latest published contract. Dashed lines are optional ports.

A source: it has no inputs.

Ports of std:file-source
PortDirectionKindRequiredDescription
outoutputrecordsyes

Parameters #

Parameters of std:file-source
NameTypeDefaultRequiredDescription
pathstringnoneyes

When to use it #

  • A pipeline that always reads the same file, for example a nightly export at a fixed path.
  • Read a second, fixed data set next to the pipeline's main input.

When to use something else

  • The node needs a filesystem.read grant that covers path; without it the run is refused with E_PERMISSION. It reads NDJSON only: for CSV, read the file as a text input of the pipeline and convert with std:csv-decode.

A tested example #

Nothing here is invented: this is the test “reading without a filesystem grant is refused” from the pipe's own portable test file, which every conformant runner must pass.

Parameters
{
  "path": "some-file.ndjson"
}
Input: —

This test gives the pipe no input.

Expected output: —

Expected result: the run fails with E_PERMISSION. Nothing is written to the outputs.

The test grants the node no permissions.

The same step as a node of a pipeline.yaml:

pipeline.yaml
nodes:
  file-source:
    pipe: std:file-source
    parameters:
      path: "some-file.ndjson"

Written like this, the node is refused, exactly as in the test: it needs a grant.

Notes from the manifest #

The pipe's manifest, OPENFLANGE.md, carries these notes.

Part of the OpenFlange standard library (std, version 0.1).

A source that reads an NDJSON file (UTF-8, one JSON value per line; blank lines and invalid JSON are E_FORMAT) and emits one item per line. A missing final newline is tolerated.

Permission #

The permission this pipe needs depends on its path parameter, which a static manifest cannot express; it is a dynamic permission requirement of the standard library: filesystem.read covering path. The consumer must grant it and the runner enforces it — a granted path covers itself and, for a directory, everything beneath it, after both are made absolute and symbolic links are resolved. Without a covering grant the run is refused with E_PERMISSION before the file is touched.

sh
openflange run pipeline.yaml --grant fs.read=./data

path must be a literal or a $param binding. A relative path resolves against the directory of the pipeline file that contains the node (the working directory when the pipe is run directly).

Reference #

Maturity
Experimental
Manifest version
0.1.0