Skip to content
Prev 12612 / 63461 Next

stdout == 'Terminal' or 'File' {was 'bad interaction ...'}

MartinS> Dear Ben,

    MartinS> I do not know how to solve the general problem that
    MartinS> backspaces cause within Sweave, but which are
    MartinS> needed to implement running counters.

aha!  now I understand more what you are talking about.

This is a more interesting problem, in general: It's not quite a
matter of if(interactive()) that Ben tried, but really you want
to find out if the stdout() connection you are using is a normal file
(where you don't need or want a running counter) or a 
user terminal where Martin Schlather applied the  1^H2^H... ('1' Backspace
'2' Backspace ..) trick.

Any ideas what can be done here, using our current  connection
tools -- or is there the need for something new?
Interesting topic!

Martin M?chler

PS. I know that strictly speaking the subject question is
 non-sense, since, at least on Unix-alikes, a console is a
 special file as well, and stdout is always a file.