Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed3a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.011 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'binary': 0.07; 'convention.': 0.07; 'cc:addr:python-list': 0.11; 'windows': 0.15; '-tkc': 0.16; 'command-line': 0.16; 'eof': 0.16; 'filters,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; ':-)': 0.16; 'wrote:': 0.18; 'obviously': 0.18; 'wed,': 0.18; 'all,': 0.19; 'platforms': 0.22; 'cc:addr:python.org': 0.22; 'tend': 0.24; 'file.': 0.24; 'cc:2**0': 0.24; "i've": 0.25; 'header:In-Reply- To:1': 0.27; 'chris': 0.29; 'am,': 0.29; 'tim': 0.29; 'unix': 0.29; "doesn't": 0.30; 'said,': 0.30; 'message- id:@mail.gmail.com': 0.30; 'chase': 0.31; 'ones.': 0.31; 'file': 0.32; "can't": 0.35; 'done.': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'done': 0.36; 'basis.': 0.38; 'though,': 0.39; 'tell': 0.60; "you're": 0.61; 'life': 0.66; 'jul': 0.74; 'rexx,': 0.84; 'canonical': 0.91; 'to:none': 0.92 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=LCXPu5s2H4sFn7Wxn37rOP861R3xDRD+5E9tJhqiMm4=; b=Z201ckA+GYOA9fswR0gsVHLkh1Vk0AoEy9PqNgT+Cyn3+iF0G5yvNRWwyHdZvIatbW Z0ZFBuLFvhCPXQkL/SpBp7saeHWckFScdzhzYYxTkfnHuU0Owv2yA+2mvA1sh8YrfuTv Hk9EWtrOtdn1/3VamjqIO2NF6A8BCUdkUFK1Cbsl5MiTMXBocbr02/f5umPKjw3fYLTJ 6BEv6/bKR76lZeQ5cSxFXHyQn/n3Rak4rsjVAofGGkVtqeNFHIZPVzpX2olKpPEW+ks3 wm+xoveYlNiwAI61liWDp2lQUyrkDEvS/ao+nPlKhlMth1iV38JsfE7YLCXTpqZ6ZrLe bn2g== MIME-Version: 1.0 X-Received: by 10.221.20.133 with SMTP id qo5mr1085423vcb.53.1404834578893; Tue, 08 Jul 2014 08:49:38 -0700 (PDT) In-Reply-To: <20140708104635.350592d0@bigbox.christie.dr> References: <53ba11fc$0$29985$c3e8da3$5496439d@news.astraweb.com> <53ba538d$0$2926$c3e8da3$76491128@news.astraweb.com> <20140708102033.13efb3a4@bigbox.christie.dr> <20140708104635.350592d0@bigbox.christie.dr> Date: Wed, 9 Jul 2014 01:49:38 +1000 Subject: Re: open() and EOFError From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 26 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1404834587 news.xs4all.nl 2942 [2001:888:2000:d::a6]:53689 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:74178 On Wed, Jul 9, 2014 at 1:46 AM, Tim Chase wrote: > On 2014-07-09 01:24, Chris Angelico wrote: >> On Wed, Jul 9, 2014 at 1:20 AM, Tim Chase >> > Okay, EOF is the canonical way to tell a program reading stdin >> > that you're done. It just happens that EOF ^D on *nix-likes and >> > ^Z on Win32. :-) >> > >> > -tkc >> >> I can't think of any Windows-native programs that ask for EOF. Only >> those which came from POSIX platforms do it. That said, though, >> Windows doesn't tend to encourage interactive command-line programs >> at all, so you may as well just follow the Unix convention. > > There was a time in life where I used "copy con output.txt" on a > disturbingly frequent basis. Control+Z ended my file for me. > Yes, and I've done that with a few programs (sort comes to mind; also Regina Rexx, because it lacked a true interactive interpreter), but not interactive ones. Those programs are filters, so obviously EOF is the way to signal, well, end of file. (Have you ever used COPY CON to create a binary file?) ChrisA