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 21:27:42 +0100 Organization: albasani.net Lines: 37 Message-ID: References: <4f5d18ef$0$291$14726298@news.sunsite.dk> <4f5d239d$0$293$14726298@news.sunsite.dk> <4f5e3743$0$293$14726298@news.sunsite.dk> <4f5e5780$0$282$14726298@news.sunsite.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 8bit X-Trace: news.albasani.net Ov7EXd/Gbc+PHdJztfeRjQy7BhMOzyd1AhV5GDqfhF1+dmiUEM6hThyqyGgZ/O/Q5Jy9B/sILfHdNmrqXMJm9gVlJUgWMEXol+SdjTbskyc2mnYcJT0SOFUJ+Fewrni9 NNTP-Posting-Date: Mon, 12 Mar 2012 20:27:42 +0000 (UTC) Injection-Info: news.albasani.net; logging-data="RIGHkm8hQA4ZLFtMkbIS36g1ATrxTKzTZ88/B6hedLYPxkuKIBHGNS3gx2H3yXrMZ6JGp+z86CHoTLUIaePzyG2Mu+huRfM9qHKDLYt2O0E2xhutRPDGe8erT2njinBk"; 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: <4f5e5780$0$282$14726298@news.sunsite.dk> Cancel-Lock: sha1:u9IAgHVg4ewPgshIC91piJwRpjI= Xref: csiph.com comp.lang.java.programmer:12919 Arne Vajhøj schrieb: > > CTRL/D or CTRL/Z are not portable (I am pretty sure that > an EBCDIC based system does not have such). Do you see some Ctrl-D or Ctrl-Z in my code? Except as explanatory in a prompt? > CTRL/C is not portable either. Do you see some Ctrl-C in my code? But SIGINT is widely supported, even on: - z/OS - AIX http://www.ibm.com/developerworks/java/library/i-signalhandling/ Whether you issue it via Ctrl-C, or some kill don't know what in a separate process doesn't matter. Here is a reminder for you: The posed problem is as follows IF sigint is supported THEN how sould FileInputStream(FileDescriptor.in) behave? I don't care about those platforms where there is no sigint. The problem is then automatically resolved. The IF THEN is trivially true. Bye