Creates a flow object that watches one or more files.
flow_file_source(file_path, flow_options = get_flow_options())
file_path | A (named) vector of file paths to be watched or a
|
---|---|
flow_options | List of options created using |
The flow object.
This flow object does not throw an error if the file_path
is missing,
but it changes its state. Hece, it can be used to trigger a downstream
flow object if the file is now present, changed or missing.
# 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)