9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Ethan Grammatikidis <eekee57@fastmail.fm>
To: 9fans@9fans.net
Subject: Re: [9fans] simple question: multiple rename
Date: Tue, 16 Jun 2009 13:43:31 +0100	[thread overview]
Message-ID: <20090616134331.e7114d5e.eekee57@fastmail.fm> (raw)
In-Reply-To: <ed869b24bea5fb79811431952829f153@quanstro.net>

On Tue, 16 Jun 2009 08:00:44 -0400
erik quanstrom <quanstro@quanstro.net> wrote:

> > note that this won't work if the filenames contain white space.
> >
> > (i still regret the fact that white space became allowable in file names)
>
> using ws in filenames is a fossil-only problem;
> kfs, cwfs and ken's fs won't allow it.
>
> fortunately, fossil is easy to fix
>
> /n/dump/2009/0616/sys/src/cmd/fossil/9p.c:102,108 - 9p.c:102,108
>   	}
>
>   	for(p = name; *p != '\0'; p++){
> - 		if((*p & 0xFF) < 040){
> + 		if((*p & 0xFF) <= 040){
>   			vtSetError("bad character in file name");
>   			return 0;
>   		}
>
> - erik
>

So what happens when you drawterm from a un*x box or access a VFAT partition? Perhaps 9fat could dynamically translate spaces in filenames to some character illegal in Windows file names and not special to rc, if there is such a character. I don't recall what characters are illegal in Windows filenames but for the purposes of example assume ~ is illegal:

On-disk filename:
	Program Files
9fat represents this to plan 9 processes as:
	Program~Files

To pick an extreme (and fictional) example:
on-disk:
The Evolution of Conciousness in the Breakdown of the Bicameral Mind.doc
translated:
The~Evolution~of~Conciousness~in~the~Breakdown~of~the~Bicameral~Mind.doc
or
The]Evolution]of]Conciousness]in]the]Breakdown]of]the]Bicameral]Mind.doc
etc.

It would be great if the substitute character could be one not special to regexps.


Un*x seems a harder issue since no character is actually illegal, but I notice many ASCII control characters are not at all special to plan 9 or drawterm and are extremely unlikely to be present in a un*x filename. Vertical tab, perhaps; control-K. For that matter this trick could be used for Windows filesystems too, I'm quite sure control-chars are unacceptable there.


--
Ethan Grammatikidis
The lyf so short, the craft so long to lerne. -- Chaucer



  reply	other threads:[~2009-06-16 12:43 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-05 19:58 Rudolf Sykora
2009-06-05 20:04 ` Martin Harriss
2009-06-05 20:07   ` Rudolf Sykora
2009-06-08  7:50 ` Rudolf Sykora
2009-06-08  9:35   ` Russ Cox
2009-06-16 11:51     ` roger peppe
2009-06-16 12:00       ` erik quanstrom
2009-06-16 12:43         ` Ethan Grammatikidis [this message]
2009-06-16 12:52           ` erik quanstrom
2009-06-16 14:07             ` Russ Cox
2009-06-16 14:40               ` erik quanstrom
2009-06-16 23:00             ` Ethan Grammatikidis
2009-06-16 23:01               ` erik quanstrom
2009-06-17 14:34                 ` Ethan Grammatikidis
2009-06-18 22:54                 ` John Floren
2009-06-18 22:59                   ` erik quanstrom
2009-06-16 15:48           ` Charles Forsyth
2009-06-16 15:31             ` erik quanstrom
2009-06-16 22:57               ` Ethan Grammatikidis
2009-06-16 15:55           ` john
2009-06-16 17:19             ` Tim Newsham
2009-06-16 23:05             ` Ethan Grammatikidis
2009-06-08  9:45   ` Martin Neubauer
2009-06-08 10:40     ` Rudolf Sykora
2009-06-16 18:34 Francisco J Ballesteros

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=20090616134331.e7114d5e.eekee57@fastmail.fm \
    --to=eekee57@fastmail.fm \
    --cc=9fans@9fans.net \
    /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).