[plt-scheme] v299 and pattern matching filenames

From: Robby Findler (robby at cs.uchicago.edu)
Date: Tue Nov 9 13:03:24 EST 2004

It depends on the encoding used to create the path. Paths are just
sequences of bytes. In order to turn those bytes into a string, you
have to pick some kind of encoding format. For example, a common one is
utf-8. Under a utf-8 encoding, some sequences of bytes just don't map
to a valid set of characters.

Of course, if you stick with ASCII, you won't run into these problems,
but if you want to support other character sets (say, Chinese writing,
for example) you have to move beyond ASCII.

Robby

At Tue, 9 Nov 2004 20:00:28 +0200, ifconfig nslookup wrote:
> Can I ask what paths cannot be converted to strings?
> 
> ifconfig
> 
> 
> On Tue, 9 Nov 2004 10:57:13 -0600, Robby Findler <robby at cs.uchicago.edu> wrote:
> >  For list-related administrative tasks:
> >  http://list.cs.brown.edu/mailman/listinfo/plt-scheme
> > 
> > You should use path->bytes and byte regexps, in this case. Use
> > path->string to display the strings to the user, but otherwise try to
> > avoid it (because not all paths can be turned into strings anymore).
> > 
> > path->bytes and bytes->path, on the other hand (modulo some windows
> > issues that may even be worked out by now) don't lose any information.
> > 
> > Robby
> > 
> > 
> > 
> > At Tue, 9 Nov 2004 08:53:43 -0800 (PST), Ron Stanonik wrote:
> > >   For list-related administrative tasks:
> > >   http://list.cs.brown.edu/mailman/listinfo/plt-scheme
> > >
> > > I'm porting an application from v208 to v299.  In v208 paths were strings
> > > and I used regexp-match to identify files (eg, .jpg or logNNNNN).  In v299
> > > paths are not strings, but a new type.  A solution is to path->string, then
> > > regexp-match.
> > >
> > > Is path->string the solution or is there some path matching, which I should
> > > be using.
> > >
> > > Thanks,
> > >
> > > Ron
> > > stanonik at cogsci.ucsd.edu
> >


Posted on the users mailing list.