![]() |
SolarCapture C Bindings User Guide
SF-115721-CD
Issue 1
|
Reads data from a file or file descriptor.
This node reads data from a file in the filesystem, or from a file descriptor, and passes the data to its output link.
By default each output buffer contains data from a single read() call. This may be less than a full buffers worth if the file descriptor is a socket or pipe. Set fill_buffers=1 to ensure that each buffer is filled completely before releasing it to the output.
If the input file descriptor is a datagram socket or similar (and fill_buffers=0) then each output packet will contain a single datagram.
Argument | Optional? | Default | Type | Description |
---|---|---|---|---|
filename | Yes | SC_PARAM_STR | The name of a file to read data from. (If fd is also set then this name is just informational). | |
fd | Yes | SC_PARAM_INT | File descriptor to read data from. | |
signal_eof | Yes | 1 | SC_PARAM_INT | Set to 0 to prevent this node from signalling end-of-stream when the whole file has been read. |
close_on_eof | Yes | 1 | SC_PARAM_INT | Whether to close the file descriptor when the whole file has been read. |
fill_buffers | Yes | 0 | SC_PARAM_INT | Whether or not to completely fill output packets. |
repeat | Yes | 0 | SC_PARAM_INT | If set to true, when we reach the end of the file, we seek to the beginning again and keep reading. |
repeat_offset | Yes | 0 | SC_PARAM_INT | Offset to seek to if repeating. (This can be used to skip a per-file header). |