flow_file_source: Creates a flow object that watches one or more files

Description Usage Arguments Details Value Examples

View source: R/source-file.R

Description

Creates a flow object that watches one or more files

Usage

1

Arguments

file_path

A (named) vector of file paths to be watched or a fs_path object.

flow_options

List of options created using get_flow_options. All options except eddy are ignored.

Details

This flow object does not throw an error if the file_path is missing, but it changes its state. Hence, it can be used to trigger a downstream flow object if the file is now present, changed or missing.

Value

The flow object.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# write for the first time content in file and create flow
file_temp <- tempfile(pattern = "example_source")
write.csv(head(mtcars), file_temp, row.names = FALSE)
rflow_source <- flow_file_source(file_temp)

# write other content in the same file
# now the flow object will update its state
write.csv(tail(mtcars), file_temp, row.names = FALSE)
rflow_source <- flow_file_source(file_temp)
unlink(file_temp)

numeract/rflow documentation built on May 28, 2019, 3:39 p.m.