From: matz@... (Yukihiro Matsumoto) Date: 2002-03-04T17:01:14+09:00 Subject: Re: Readline loses stdin? Hi, In message "Readline loses stdin?" on 02/03/04, Massimiliano Mirra writes: |Between reading the first and the second line, I'm trying to have the |program read from a file as it were its standard input, then close the |file and restore things as they were, then finally reading a second |line. Apparently, I'm missing something. Assignment to $stdin etc. re-connect corresponding stdio. You have to preserve the original using "dup". It still is under discussion for 1.7 (and 1.8), but "dup" works anyway. oldin = $stdin.dup $stdin = File.open(".bash_profile") $stdin.close $stdin = oldin matz.