Examples for 'curl::file_writer'


Lazy File Writer

Aliases: file_writer

Keywords:

### ** Examples

# Doesn't open yet
tmp <- tempfile()
writer <- file_writer(tmp)

# Now it opens
writer(charToRaw("Hello!\n"))
[1] 7
writer(charToRaw("How are you?\n"))
[1] 13
# Close it!
writer(charToRaw("All done!\n"), close = TRUE)
[1] 10
# Check it worked
readLines(tmp)
[1] "Hello!"       "How are you?" "All done!"   

[Package curl version 5.2.3 Index]