>>>>> Carlos Alberto Roman Zamitiz writes:

    Carlos> I have a problem:
    Carlos> The file called Outtest.java reads the file called "test.out" which
    Carlos> contains:
    Carlos> A
    Carlos> B
    Carlos> C
    Carlos> D
    Carlos> E

    Carlos> but when I type java Outtest, this shows:
    Carlos> A
    Carlos> B
    Carlos> C
    Carlos> D
    Carlos> E

    Carlos> and never returns prompt. I need type Control-C and this
    Carlos> returns the prompt.


            for (;;) {
                try {
                    while ((c = lin.read()) != -1) {
                        System.out.write(c);
                    }
                } catch (Exception e) {}
            }

No surprise, your code never gets out of the endless for-loop (even
on linux infinite loops may take several minutes to execute :-).
Remove the for-loop and your program will work.


        Juergen

-- 
Juergen Kreileder, Universitaet Dortmund, Lehrstuhl Informatik V
Baroper Strasse 301, D-44221 Dortmund, Germany
Phone: ++49 231/755-5806, Fax: ++49 231/755-5802

Reply via email to