Path: csiph.com!usenet.pasdenom.info!news.albasani.net!.POSTED!not-for-mail From: Jan Burse Newsgroups: comp.lang.java.programmer Subject: Re: [Windows] Any way to distinguish ^C Induced EOF from ^Z EOF? Date: Mon, 12 Mar 2012 20:46:17 +0100 Organization: albasani.net Lines: 17 Message-ID: References: <4f5d18ef$0$291$14726298@news.sunsite.dk> <4f5d239d$0$293$14726298@news.sunsite.dk> <4f5e3743$0$293$14726298@news.sunsite.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: news.albasani.net ITcYUmP4lOS84IbqYgDWdL1uI1Zxgt0499hFLkYdhNDtQjb+6a4wRWuDzf1ooflKjGQcD+kW0DgTtMYjnLQ1mCHZWvVexf7mIvH+UTjCZUaD1nR4OudsrNWDOC0j4WcN NNTP-Posting-Date: Mon, 12 Mar 2012 19:46:17 +0000 (UTC) Injection-Info: news.albasani.net; logging-data="WUB6t+zU3gBorqlyMzymvGzCL7Uf0qSvpK+DtKU7r5IqM5LoAOx22Jxh0F4I58Cx3uy9/5dd0hF0HsWLqGTeli5xfy7Aztwp26Vh35Gqq7A6MiirAu2v8ALkCrKOzm0P"; mail-complaints-to="abuse@albasani.net" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0.2) Gecko/20120216 Firefox/10.0.2 SeaMonkey/2.7.2 In-Reply-To: Cancel-Lock: sha1:bdCLeO9TVusis62Go8XzsQ0NLlk= Xref: csiph.com comp.lang.java.programmer:12913 Leif Roar Moldskred schrieb: > Oh _come on_! If you insist on writing a console-based interactive > program in Java, at least have enough common sense to not choose > control codes for the expected user input. I didn't choose control codes. I chose end-of-file of a stream. Which is on a windows console ^Z and in Mac or Linux ^D. But this is only the most common default, it could be also other key combinations, and I guess it can be configured in some console utilities. And its very common that programs assume that everything is fine when a end-of-file is encountered, and that they then commit their work. This is the sunshine case. Bye