openstream {Rstreams} | R Documentation |
Open or close a file for binary reading and writing.
stream <- openstream(filename, mode = "read") closestream(stream)
filename |
a string containing a single file name. Tilde-expansion is performed on the file name. |
mode |
the mode in which to open the file, either "read"
or "write" . |
stream |
a previously opened stream, or the special string
"all" to close all streams. |
an object of the stream class is returned by openstream
.
s <- openstream("mydata", "write") s # Write the bytes from 1 to 100 to the file writeint(s, 1:100, 1) summary(s) closestream(s) unlink("mydata")