On Tue, 16 Jun 2009 08:00:44 -0400
erik quanstrom <quans...@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 via email to