Ports #
A source: it has no inputs.
| Port | Direction | Kind | Required | Description |
|---|---|---|---|---|
out | output | records | yes |
Parameters #
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
path | string | none | yes |
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.readgrant that coverspath; without it the run is refused withE_PERMISSION. It reads NDJSON only: for CSV, read the file as atextinput of the pipeline and convert withstd: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.
{
"path": "some-file.ndjson"
}This test gives the pipe no input.
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:
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.
openflange run pipeline.yaml --grant fs.read=./datapath 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
- Normative definition: std:file-source, std:file-sink in the standard library specification
- Manifest and tests: std/0.1/file-source in the specification repository