Functions to push back text lines onto a connection, and to enquire how many lines are currently pushed back.
1 2 3 4
a character vector.
logical. If true, a newline is appended to each string pushed back.
character string, partially matched. See details.
Several character strings can be pushed back on one or more occasions.
The occasions form a stack, so the first line to be retrieved will be
the first string from the last call to
pushBack. Lines which
are pushed back are read prior to the normal input from the
connection, by the normal text-reading functions such as
Pushback is only allowed for readable connections in text mode.
Not all uses of connections respect pushbacks, in particular the input
connection is still wired directly, so for example parsing
commands from the console and
scan("") ignore pushbacks on
When character strings with a marked encoding (see
Encoding) are pushed back they are converted to the
current encoding if
encoding = "". This may involve
representing characters as <U+xxxx> if they cannot be
converted. They will be converted to UTF-8 if
"UTF-8" or left as-is if
encoding = "bytes".
clearPushBack() return nothing, invisibly.
pushBackLength returns the number of lines currently pushed back.
1 2 3 4 5 6 7 8 9
Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.