9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Elliott.Hughes@genedata.com Elliott.Hughes@genedata.com
Subject: [9fans] allowing space (ASCII 0x20) in file names
Date: Tue, 14 Apr 1998 15:35:58 +0200	[thread overview]
Message-ID: <19980414133558.PnIQOKekQeduk7a-c8jqICSFRxAR6NA33NvimZPbMWU@z> (raw)

> > One thing I don't get is why "Fields that contain names are 28-byte
> > strings (including a terminal NUL (zero) byte)". Why send the zero,
> > if it's always zero and it's always there? Why not use these 28 bytes
> > as a sort of persistant fid?
> 
> If you don't send the zero, how do you indicate filenames less
> than 27 bytes?  How would "x.c" get transmitted?

As { 'x', '.', 'c', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }.
Not sure I counted that right, but you get the idea, I'm sure!

> I suppose you
> could increase the name length by one by adding the hack that
> there's an implicit zero on byte 29 that isn't transmitted,
> but it's an ugly hack for a questionable cause (one byte?) and
> it would make things like strlen, etc. annoying.

I assume that ease of dealing with the message (you know the name you're
pulling out of it is already a C string) is the reason for the waste. I was just
wondering out loud because most of us don't know what discussion went
on at the labs before such decisions were made. (And if outsiders question
the wisdom of these decisions and wonder about rejected alternatives, they
like as not get insulted for daring to question AT&T wisdom. That's
how it looks to me, anyway.)

But increasing the name length by one byte wasn't really my intention (though
maybe then that real-audio configuration file that's in my NFS home directory
would be available to Plan 9). I was thinking more of using all 28 bytes -- seeing
as we send them anyway -- with no NUL termination. You wouldn't use
them as UTF-8 strings, rather as 28 * 8 bit persistant fids that the server
keeps track of. [Something like the inode + device number from the old days.]

You could use a different mechanism to work out what persistant fid it
was you were looking for: you could have filenames if you chose, or you
could have a database interface (perhaps to pictures, for which filenames
aren't really sufficient).

Anyway, the point is that you'd then have a larger and much more
convenient space to play about with alternative mappings in.

There's been some mention of Styx in this discussion. Is there anywhere I can
get an up-to-date specification of Styx (and the other parts of Inferno) without
paying? I'm interested particularly in what changes, if any, there have been
since 9p (assuming, as I do, that Styx is more-or-less 9p).

-- 
http://users.ch.genedata.com/~enh/




             reply	other threads:[~1998-04-14 13:35 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-04-14 13:35 Elliott.Hughes [this message]
  -- strict thread matches above, loose matches on Subject: below --
1998-04-14 15:18 Russ
1998-04-14 15:16 Tom
1998-04-14 13:50 Rob
1998-04-14 13:04 Russ
1998-04-14  9:50 Elliott.Hughes
1998-04-14  9:08 Elliott.Hughes
1998-04-14  6:38 Nigel
1998-04-14  6:24 forsyth
1998-04-14  5:33 forsyth
1998-04-13 23:03 geoff
1998-04-13 13:50 G.David
1998-04-13  6:00 geoff
1998-04-12  3:27 ozan
1998-04-10 14:49 G.David
1998-04-10 14:43 forsyth
1998-04-10  4:04 geoff
1998-04-10  1:03 G.David
1998-04-09 23:44 Tom
1998-04-09 22:08 G.David
1998-04-09  3:10 G.David
1998-04-08 23:56 G.David
1998-04-08 22:05 Rob
1998-04-08 21:54 G.David
1998-04-08 20:32 Russ
1998-04-08 19:58 G.David
1998-04-08 17:45 Tom
1998-04-08 17:08 Russ
1998-04-08 16:56 G.David

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=19980414133558.PnIQOKekQeduk7a-c8jqICSFRxAR6NA33NvimZPbMWU@z \
    --to=elliott.hughes@genedata.com \
    /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).