9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: "Russ Cox" <rsc@plan9.bell-labs.com>
To: 9fans@cse.psu.edu
Subject: Re: [9fans] Weirdness with 9660srv and file names (extensions)?
Date: Sun, 27 Jan 2002 14:29:05 -0500	[thread overview]
Message-ID: <20020127192906.BC8B6199E4@mail.cse.psu.edu> (raw)

The ISO9660 spec (actually I was reading ECMA 119, which
is supposedly identical) is fairly clear about this issue:
every file on the volume should have a . and a ; in
its name, since they are separators rather than file
name characters.  That is, every name is supposed to
be of the form

	file name . file extension ; version

Most writers (including our very own mk9660) don't
put the . and ; in when there is nothing to separate,
so our mishandling of the trailing . hadn't been
noticed before.

Thus I propose replacing

		p = strchr(d->name, ';');
		if(p != 0) {
			vers = strtoul(p+1, 0, 10);
			memset(p, 0, NAMELEN-(p-d->name));
		}

with

		if(fmt!='9' && !(d->mode&CHDIR)){
			/*
			 * ISO 9660 actually requires that you always have a . and a ;,
			 * even if there is no version and no extension.  Very few writers
			 * do this.  If the version is present, we use it for qid.vers.
			 * If there is no extension but there is a dot, we strip it off.
			 * (DOS heads couldn't comprehend the dot as a file name character
			 * rather than as just a separator between name and extension.)
			 *
			 * We don't do this for directory names because directories are
			 * not allowed to have extensions and versions.
			 */
			if((p=strchr(d->name, ';')) != nil){
				vers = strtoul(p+1, 0, 0);
				d->qid.vers = vers;
				memset(p, 0, NAMELEN-(p-d->name));
			}
			if((p=strchr(d->name, '.')) != nil && *(p+1)=='\0')
				memset(p, 0, NAMELEN-(p-d->name));
		}

Russ


             reply	other threads:[~2002-01-27 19:29 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-01-27 19:29 Russ Cox [this message]
2002-01-27 19:37 ` Alexander Viro
2002-01-28 18:11   ` Boyd Roberts
2002-01-28 23:23 ` Dan Cross
2002-01-28 23:30   ` William S.
  -- strict thread matches above, loose matches on Subject: below --
2002-01-27 19:55 Russ Cox
2002-01-25  8:45 forsyth
2002-01-25 22:24 ` Dan Cross
2002-01-24 16:13 Russ Cox
2002-01-24 16:22 ` Boyd Roberts
2002-01-24  7:36 Russ Cox
2002-01-24 21:53 ` Dan Cross
2002-01-24  3:22 Dan Cross
2002-01-24 15:59 ` Boyd Roberts
2002-01-25 10:00 ` bs
2002-01-25 12:40   ` Boyd Roberts

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=20020127192906.BC8B6199E4@mail.cse.psu.edu \
    --to=rsc@plan9.bell-labs.com \
    --cc=9fans@cse.psu.edu \
    /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).