9front - general discussion about 9front
 help / color / mirror / Atom feed
From: Anthony Martin <ality@pbrane.org>
To: 9front@9front.org
Subject: Re: [9front] /proc/n/fd format clarification
Date: Mon, 7 Jun 2021 16:46:21 -0700	[thread overview]
Message-ID: <YL6vzQ1lwrM7/xQX@alice> (raw)
In-Reply-To: <CAHtSCHK8NdHbajVDRMTXLgXRbhsBTT8JYo=gTi_9mdDMdchCWg@mail.gmail.com>

binary cat <dogedoge61@gmail.com> once said:
> A format that seems to have fixed width fields, but actually doesn't,
>
> [...]
>
> Either way, I do think the documentation should be clearer about this.

Fixed width fields are called out explicitly in the manuals whenever
they're used, as in draw(3),

	Each client of the device connects by opening /dev/draw/new
	and reading 12 strings, each 11 characters wide followed by
	a blank:

or acme(4),

	When read, it returns the value of the address that would
	next be read or written through the data file, formatted as
	2 decimal numbers m and n, each formatted in 11 characters
	plus a blank.

or font(6),

	Each number is right-justified and blank padded in 11 chara-
	cters, followed by a blank.

and so on. Assuming something that isn't actually written down in
the documentation is not a good idea.

> What I would do is keep the qid version as decimal (for backward
> compatibility), but simply pad it enough (10 spaces) so it's fixed
> width, like the rest of the fields. This would mean you wouldn't have
> to read through the whole file to get the filename.

This still wouldn't work since the third field, the type, is a
single UTF-8 encoded Unicode rune which is not a fixed width.

Cheers,
  Anthony

  parent reply	other threads:[~2021-06-07 23:51 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-05 13:26 binary cat
2021-06-05 21:04 ` [9front] " Anthony Martin
2021-06-05 21:58 ` [9front] " nicolagi
2021-06-07 17:16   ` binary cat
2021-06-07 23:37     ` ori
2021-06-07 23:46     ` Anthony Martin [this message]
2021-06-09 21:24       ` binary cat

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=YL6vzQ1lwrM7/xQX@alice \
    --to=ality@pbrane.org \
    --cc=9front@9front.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).