Generating End of File from Keyboard [message #201649] |
Thu, 21 April 2005 14:22 |
Eclipse User |
|
|
|
Originally posted by: DPante.aol.com
When running a stand-alone java application from within the Console
window, how can EOF be detected from a read. When the application is run
directly under DOS or UNIX, EOF is generated when Control Z (DOS/Windows)
or Control D (UNIX/Linux) is entered. However, when run within the
Console window of Eclipse, these control characters do not have any
effect. Specifically, what would need to be entered from the keyboard
(standard input) to satisfy the following read:
int c;
while((c = System.in.read()) != -1)
{
// process character here
// terminate loop on EOF
}
|
|
|
Powered by
FUDForum. Page generated in 0.02864 seconds