I'm creating a file connection via path <- file("C:/test.txt")
and when printing the object associated to the connection I can see the connection's "attributes":
> path
description class mode text opened
"C:/test.txt" "file" "r" "text" "closed"
can read can write
"yes" "yes"
However, I can't seem to figure out how to actually access the various attribute values
Here's what I tried so far:
> attributes(path)
$class
[1] "file" "connection"
$conn_id
<pointer: 0x0000004b>
> path$description
Error in path$description : $ operator is invalid for atomic vectors
> path["description"]
[1] NA
> file.info(path)
Error in file.info(path) : invalid filename argument
Any ideas?
A quick look at
base:::print.connection
will show that you wantsummary(path)
.