adf_file_con | R Documentation |
Open a connection to a file on a virtual ADF device. The created connection (if valid)
should be accepted by any R function that reads from or writes to a connection,
such as readLines()
, writeLines()
, readBin()
, writeBin()
, etc.
adf_file_con(x, ..., writable = FALSE)
## S3 method for class 'adf_device'
adf_file_con(x, path, ..., writable = FALSE)
## S3 method for class 'character'
adf_file_con.adf_device(x, path, ..., writable = FALSE)
## S3 method for class 'virtual_path'
adf_file_con(x, ..., writable = FALSE)
x |
Either a connection to a virtual ADF device created with |
... |
Ignored. |
writable |
A |
path |
Only required when |
Returns an R connection that can be handled by any function that
accepts a connection for reading or writing. Remember to call close()
after
use.
Pepijn de Vries
## First setup a connection to a virtual device
adz_file <- system.file("example.adz", package = "adfExplorer")
my_device <- connect_adf(adz_file)
## Open a connection to a file on the virtual device
fcon <- adf_file_con(my_device, "DF0:s/startup-sequence")
## Read from the file
my_startup <- readLines(fcon, warn = FALSE)
## Close the file
close(fcon)
## Close the virtual device
close(my_device)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.