Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #79302
| Return-Path | <cameron@cskk.homeip.net> |
|---|---|
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.001 |
| X-Spam-Evidence | '*H*': 1.00; '*S*': 0.00; 'python.': 0.02; 'python,': 0.02; 'output': 0.05; 'tom': 0.07; 'dan': 0.09; 'default.': 0.09; 'excluding': 0.09; 'output,': 0.09; 'seemed': 0.09; 'python': 0.11; '>on': 0.16; 'buffering,': 0.16; 'from:addr:cs': 0.16; 'from:addr:zip.com.au': 0.16; 'from:name:cameron simpson': 0.16; 'message-id:@cskk.homeip.net': 0.16; 'received:211.29': 0.16; 'received:211.29.132': 0.16; 'received:cskk.homeip.net': 0.16; 'received:homeip.net': 0.16; 'received:optusnet.com.au': 0.16; 'received:syd.optusnet.com.au': 0.16; 'simpson': 0.16; 'to:name:python list': 0.16; 'sat,': 0.16; 'wrote:': 0.18; 'discussion': 0.18; '>>>': 0.22; 'candidates': 0.23; 'header:User- Agent:1': 0.23; 'case.': 0.24; 'cheers,': 0.24; 'post': 0.26; 'gets': 0.27; 'header:In-Reply-To:1': 0.27; "i'm": 0.30; 'behaving': 0.31; 'file': 0.32; 'probably': 0.32; '(i.e.': 0.33; "can't": 0.35; 'tool': 0.35; 'but': 0.35; 'really': 0.36; 'his/her': 0.36; 'otherwise.': 0.36; 'received:com.au': 0.36; 'charset:us-ascii': 0.36; 'desirable': 0.38; 'received:211': 0.38; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'anything': 0.39; 'does': 0.39; 'heard': 0.39; 'itself': 0.39; 'sure': 0.39; 'to:addr:python.org': 0.39; 'even': 0.60; 'took': 0.61; "you're": 0.61; 'further': 0.61; 'content-disposition:inline': 0.62; 'kind': 0.63; 'soon': 0.63; 'between': 0.67; 'wish': 0.70; '(standard': 0.84; 'received,': 0.84; 'pipeline': 0.91 |
| Date | Mon, 20 Oct 2014 14:56:17 +1100 |
| From | Cameron Simpson <cs@zip.com.au> |
| To | Python List <python-list@python.org> |
| Subject | Re: Flush stdin |
| MIME-Version | 1.0 |
| Content-Type | text/plain; charset=us-ascii; format=flowed |
| Content-Disposition | inline |
| In-Reply-To | <CAGGBd_r7tdPc1ZTA380-9aNRnbr6Dm3HzhG2cCH2sJwWn=c5iQ@mail.gmail.com> |
| User-Agent | Mutt/1.5.21 (2010-09-15) |
| References | <CAGGBd_r7tdPc1ZTA380-9aNRnbr6Dm3HzhG2cCH2sJwWn=c5iQ@mail.gmail.com> |
| X-Optus-CM-Score | 0 |
| X-Optus-CM-Analysis | v=2.1 cv=dMCfxopb c=1 sm=1 tr=0 a=YuQlxtEQCowy2cfE5kc7TA==:117 a=YuQlxtEQCowy2cfE5kc7TA==:17 a=ZtCCktOnAAAA:8 a=PO7r1zJSAAAA:8 a=LcaDllckn3IA:10 a=r5UFkecV8NkA:10 a=kj9zAlcOel0A:10 a=vrnE16BAAAAA:8 a=pGLkceISAAAA:8 a=BStE6XT-6nLQzKkKM3EA:9 a=CjuIK1q_8ugA:10 a=MSl-tDqOz04A:10 |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.15 |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list/> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.14990.1413777392.18130.python-list@python.org> (permalink) |
| Lines | 34 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1413777392 news.xs4all.nl 2851 [2001:888:2000:d::a6]:34728 |
| X-Complaints-To | abuse@xs4all.nl |
| Path | csiph.com!usenet.pasdenom.info!bete-des-vosges.org!feed.ac-versailles.fr!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail |
| Xref | csiph.com comp.lang.python:79302 |
Show key headers only | View raw
On 18Oct2014 18:42, Dan Stromberg <drsalists@gmail.com> wrote: >On Sat, Oct 18, 2014 at 6:34 PM, Dan Stromberg <drsalists@gmail.com> wrote: >>> Once the "nc" process actually write()s the data to its standard >>> output (i.e. desriptor 1, not the "stdout" FILE*) >> I'm not sure why you're excluding stdout, but even if nc is using >> filedes 1 instead of FILE * stdout, isn't it kind of irrelevant? > >On further reflection, isn't it stdio that does the varied buffering, >and filedes 1 that's always unbuffered? IOW, the OP might wish nc was >using 1, but it probably can't be given what they're seeing. Traditionally, fd 1 (standard output, _generally_ associated with FILE *stdout), gets stdio buffering; line buffered for a terminal, block buffered otherwise. fd 2 (standard error, _generally_ associated with FILE *stderr) gets an unbuffered stdio stream by default. However, nc may well be behaving like "tail -f": always unbuffered. However, as I recall the OP seemed to want to "flush" the stream from nc to python. Even if nc itself does no buffering (handing data to the OS as soon as received, highly desirable for a tool like nc), the OS keeps a buffer for the pipeline between nc and python, and python itself keeps a buffer for sys.stdin. Both of those are candidates for some kind of flush/discard. IF (a big IF) that is what the OP really needs. Have we heard anything from the OP since this discussion took off? I think we need to better understand his/her use case. Cheers, Cameron Simpson <cs@zip.com.au> Do you even know anything about perl? - AC replying to Tom Christiansen post
Back to comp.lang.python | Previous | Next — Next in thread | Find similar | Unroll thread
Re: Flush stdin Cameron Simpson <cs@zip.com.au> - 2014-10-20 14:56 +1100
Re: Flush stdin Marko Rauhamaa <marko@pacujo.net> - 2014-10-20 07:45 +0300
Re: Flush stdin Dan Stromberg <drsalists@gmail.com> - 2014-10-20 14:59 -0700
Re: Flush stdin Marko Rauhamaa <marko@pacujo.net> - 2014-10-21 01:54 +0300
Re: Flush stdin Dan Stromberg <drsalists@gmail.com> - 2014-10-20 15:52 -0700
Re: Flush stdin Marko Rauhamaa <marko@pacujo.net> - 2014-10-21 02:18 +0300
Re: Flush stdin Dan Stromberg <drsalists@gmail.com> - 2014-10-20 17:30 -0700
Re: Flush stdin Marko Rauhamaa <marko@pacujo.net> - 2014-10-21 07:41 +0300
Re: Flush stdin Dan Stromberg <drsalists@gmail.com> - 2014-10-21 16:16 -0700
Re: Flush stdin Marko Rauhamaa <marko@pacujo.net> - 2014-10-22 08:38 +0300
Re: Flush stdin Chris Angelico <rosuav@gmail.com> - 2014-10-22 17:23 +1100
Re: Flush stdin Marko Rauhamaa <marko@pacujo.net> - 2014-10-22 13:57 +0300
Re: Flush stdin random832@fastmail.us - 2014-10-22 11:01 -0400
Re: Flush stdin Marko Rauhamaa <marko@pacujo.net> - 2014-10-22 18:28 +0300
csiph-web