Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

"Yeah, but you're taking the universe out of context."


devel / comp.lang.python / Re: tail

SubjectAuthor
o Re: tailChris Angelico

1
Re: tail

<mailman.361.1652118723.20749.python-list@python.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18207&group=comp.lang.python#18207

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: ros...@gmail.com (Chris Angelico)
Newsgroups: comp.lang.python
Subject: Re: tail
Date: Tue, 10 May 2022 03:51:39 +1000
Lines: 24
Message-ID: <mailman.361.1652118723.20749.python-list@python.org>
References: <CABbU2U8u-arOsEO=JfRUPeNQS68TYWVUYHvp6StiNpp_xaotZQ@mail.gmail.com>
<YnijKH0NJdtDd2sa@cskk.homeip.net>
<CABbU2U8iThoCk9M0agJMqAFDq0A9hzY5kQUMW=Jm5C94NkP28Q@mail.gmail.com>
<CAPTjJmqNNrk2gjN4=nX-Ai5Y1ysd4rsWGdyfU8Aqt1=Y1_Z-cQ@mail.gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
X-Trace: news.uni-berlin.de 9imNAhPblsuTikJDuxfrrgZcSCTqwxJqDXBnqNsP1ssg==
Return-Path: <rosuav@gmail.com>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=pass
reason="2048-bit key; unprotected key"
header.d=gmail.com header.i=@gmail.com header.b=WToFU+b5;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.003
X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; '2022': 0.05; 'absolute':
0.05; 'variable': 0.05; 'thing.': 0.07; 'anyway,': 0.09; 'byte':
0.09; 'language,': 0.09; 'arbitrary': 0.16; 'barry': 0.16;
'cameron': 0.16; 'characters.': 0.16; 'chrisa': 0.16; 'encoding':
0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16;
'impossible': 0.16; 'inspect': 0.16; 'mean.': 0.16; 'reliable,':
0.16; 'simpson': 0.16; 'stdlib': 0.16; 'stream.': 0.16;
'toolkit.': 0.16; 'wrote:': 0.16; 'solve': 0.19; 'tue,': 0.19;
'to:addr:python-list': 0.20; 'code': 0.23; 'cannot': 0.25;
'binary': 0.26; 'function': 0.27; "doesn't": 0.32; 'do.': 0.32;
'message-id:@mail.gmail.com': 0.32; 'but': 0.32; 'there': 0.33;
'core': 0.34; 'header:In-Reply-To:1': 0.34; 'received:google.com':
0.34; 'from:addr:gmail.com': 0.35; 'files': 0.36; 'mon,': 0.36;
"it's": 0.37; 'received:209.85': 0.37; 'file': 0.38; 'way': 0.38;
'means': 0.38; 'received:209': 0.39; 'text': 0.39; 'still': 0.40;
'best': 0.61; "there's": 0.61; 'mode': 0.62; 'here': 0.62; 'your':
0.64; 'worked': 0.67; 'reliable': 0.74; 'mode,': 0.76; 'seek':
0.81; 'characters': 0.84; 'decent': 0.84; 'performance.': 0.84;
'sulla': 0.84
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
h=mime-version:references:in-reply-to:from:date:message-id:subject:to;
bh=G01Vm03Ee1CXoX0fJD7N/XqRHLTlZ7Hz8Rvrfvk1KPY=;
b=WToFU+b5qaxc0jKPLD6lWVnmz9DVc9gBVYMV/yMiYcwExHNqaw4y0BxPZCv7XcrmuT
F1IGI4ieKfJXskOVD5A+812+V6oSGAoHNXeg9lX5jqyXUJedti/1mazx23w8tspRJz3d
/BIp6z8K95fCO6RwcAPRkTfBrcmr5ldpLw+2iXQjINkcTrAC7iRd7sbSx7KNqzzmx/fl
FhIAonNvfdtUa+zlAhL+Mue+Ko2rFJGzWy6ZPligQ7cs4UoIe2G6PoLiMOxjNDaPVRbP
Zz1w1RNxkv6vPgFB5IFVYuU/NfAEWHOiuVYCgOmIz47o/yGhDwzA7BkkfD3RCI6vOcBA
yhZA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20210112;
h=x-gm-message-state:mime-version:references:in-reply-to:from:date
:message-id:subject:to;
bh=G01Vm03Ee1CXoX0fJD7N/XqRHLTlZ7Hz8Rvrfvk1KPY=;
b=td72z7b+nyk1vvCMEhoMOmbsFmrE5zoaOQd7l2AlaE2wUWdv5KlQKE1gazLKcRq2Vt
NFMhyy0C6i+BZOVZcEe529VWF4bRYMMG4cR7C7oMyC0PLoMU8iqKEfbOiDPySkyOoyFo
SEeqi5JK76csV+WMIf4FwujBYvlZ7XAxXU2ZPV4hVXh4ZkPJQrQN94V0GCh/RfYBewpM
C9kgBsUZKEbdwid4Z+n9crAXTP50DOBJbyA+nguKABH9kqtXxdCX1JaNMdtPJjjuYlXZ
fKh136VDSdtOvjEnZtT5HBncP5bGZ1lpVqgHWK+Y2Tu67GADG3rdvwiQxOT23o/mlebO
sR2Q==
X-Gm-Message-State: AOAM530TJ30b78x+ShVT9PfUXFQynJ5g5d6uoapGwTYXcB7XVYNO4MBS
gL0dFQpYrhkCL7HENJ7ch3ACHaYNSEIn3a7ZR2uw9bJK
X-Google-Smtp-Source: ABdhPJyDOcyj/wgB/oCAnoqrYdw2tYBinZa5rQJBot8KEoKsSDejY37ATm5OcGc732p2sqNPcYq4fdCbvyVFlCTQ/bY=
X-Received: by 2002:a5d:68c6:0:b0:20a:d654:6cae with SMTP id
p6-20020a5d68c6000000b0020ad6546caemr14465775wrw.564.1652118711984; Mon, 09
May 2022 10:51:51 -0700 (PDT)
In-Reply-To: <CABbU2U8iThoCk9M0agJMqAFDq0A9hzY5kQUMW=Jm5C94NkP28Q@mail.gmail.com>
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.39
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: <https://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>
X-Mailman-Original-Message-ID: <CAPTjJmqNNrk2gjN4=nX-Ai5Y1ysd4rsWGdyfU8Aqt1=Y1_Z-cQ@mail.gmail.com>
X-Mailman-Original-References: <CABbU2U8u-arOsEO=JfRUPeNQS68TYWVUYHvp6StiNpp_xaotZQ@mail.gmail.com>
<YnijKH0NJdtDd2sa@cskk.homeip.net>
<CABbU2U8iThoCk9M0agJMqAFDq0A9hzY5kQUMW=Jm5C94NkP28Q@mail.gmail.com>
 by: Chris Angelico - Mon, 9 May 2022 17:51 UTC

On Tue, 10 May 2022 at 03:47, Marco Sulla <Marco.Sulla.Python@gmail.com> wrote:
>
> On Mon, 9 May 2022 at 07:56, Cameron Simpson <cs@cskk.id.au> wrote:
> >
> > The point here is that text is a very different thing. Because you
> > cannot seek to an absolute number of characters in an encoding with
> > variable sized characters. _If_ you did a seek to an arbitrary number
> > you can end up in the middle of some character. And there are encodings
> > where you cannot inspect the data to find a character boundary in the
> > byte stream.
>
> Ooook, now I understand what you and Barry mean. I suppose there's no
> reliable way to tail a big file opened in text mode with a decent performance.
>
> Anyway, the previous-previous function I posted worked only for files
> opened in binary mode, and I suppose it's reliable, since it searches
> only for b"\n", as readline() in binary mode do.

It's still fundamentally impossible to solve this in a general way, so
the best way to do things will always be to code for *your* specific
use-case. That means that this doesn't belong in the stdlib or core
language, but in your own toolkit.

ChrisA

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor