Read and include files in a prompt
include_file(prompt, anyFile)
A vector of strings containing prompt augmented by the files refered to in the original prompt.
If anyFile[i]
is TRUE
then the sequence of characters following the instruction "ff:"
in prompt[i]
is read until the next space or the end of the string. This extracted string is assumed to be a file name. This file is looked for in the current working directory or any of its sub-directories. Once detected, the file is read with readLines()
and this content is inserted in prompt
between prompt[i-1]
and prompt[i+1]
. Note that prompt[i]
is therefore deleted.
The result is returned.