Closed nick-komick closed 6 years ago
Have you tried readLines(file("stdin"), n=1)
? Using file("stdin")
is different from stdin()
(see ?readLines
and ?file
).
I'm not strictly opposed to adding functionality, but that base R solution should work.
Would you consider adding a
getUserText()
function that mirrors thegetPass_readline_masked
C function but with no mask?I have found it challenging to use
readline
andreadLines(con=stdin())
to collect user input from the console on windows within a batch file.A modified version of the getPass package with the "*" masked removed works well for getting user input from the console when a script is run from a windows batch file.