All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sami Kerola <kerolasa@iki.fi>
To: renyuneyun <renyuneyun@gmail.com>
Cc: util-linux <util-linux@vger.kernel.org>, Karel Zak <kzak@redhat.com>
Subject: Re: [PATCH] scriptreplay: determine if script --quiet was used to create typescript
Date: Sat, 22 Apr 2017 22:35:43 +0100	[thread overview]
Message-ID: <CAG27Bk0Din86R7BuOpOecFY5-1pVbiPtfVFWfU5BUD2pk9hE5A@mail.gmail.com> (raw)
In-Reply-To: <6e1ffae1-ef23-f65d-3397-4b963f069cab@gmail.com>

On 19 April 2017 at 23:04, renyuneyun <renyuneyun@gmail.com> wrote:
>> I agree. What comes to header data it should include header length
>> in bytes. Something like
>>
>> ### script(1) typescript; Header Length: 104 Version: util-linux
>> v2.30; Date: 2017-04-18 12:10:43+0200
>>
>> As long it's easy to know how long to jump rest of the format does
>> not really matter. Right.
>
> Forgive my witless, what's the point of introducing a length? Doesn't we
> already know the header takes (and only takes) the first line?

That's true until something happens and multiline header is needed.
Secondly having a header lengh makes jumping over it really, really easy
and universal[1].  By that I mean no matter how many lines, no translator
can add new lines if they wish, scales well after header is thousands items
long, perhaps somethine else as well.  Sure this extra element header a
little longer, but I cannot think of any other downside.

[1] ref:
    long offset;
    fscanf(tfile, "### script(1) typescript; Header Length: %ld ", &offset);
    fseek(tfile, offset, SEEK_SET);

-- 
Sami Kerola
http://www.iki.fi/kerolasa/

      reply	other threads:[~2017-04-22 21:35 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-14 20:39 [PATCH] scriptreplay: determine if script --quiet was used to create typescript Sami Kerola
2017-04-15  8:43 ` Sami Kerola
2017-04-18 10:23 ` Karel Zak
2017-04-19 18:11   ` Sami Kerola
2017-04-19 21:57     ` renyuneyun
2017-04-19 22:04     ` renyuneyun
2017-04-22 21:35       ` Sami Kerola [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAG27Bk0Din86R7BuOpOecFY5-1pVbiPtfVFWfU5BUD2pk9hE5A@mail.gmail.com \
    --to=kerolasa@iki.fi \
    --cc=kerolasa@gmail.com \
    --cc=kzak@redhat.com \
    --cc=renyuneyun@gmail.com \
    --cc=util-linux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.