[plt-scheme] v299: process* file args, paths, strings, and byte-strings

From: John Clements (clements at brinckerhoff.org)
Date: Tue Oct 19 21:55:27 EDT 2004

On Oct 19, 2004, at 9:02 PM, Matthew Flatt wrote:
>
> `path->string' should be right. Under Unix and Mac OS X, `process*'
> will convert its arguments to bytes using the current locale's
> encoding, and `path->string' converts the path to a string using the
> current locale's encoding, so they're consistent.
>
> It's possible to have a path that can't be expressed in the locale's
> encoding. In that case, though, you wouldn't be able to type the
> corresponding command in your shell (er, assuming that your shell uses
> the locale encoding, which it probably does).

This came up for me, too.

IIUC, MzScheme should 'know' when it gets a path that can't be 
expressed in the locale's encoding, right?  So it should be possible to 
have a 'path->string/conservative' that signals an error if the path 
can't be expressed as a string?

I admit that this is a peculiar corner case, but it _would_ seem 
possible to have two independent file-system entities (A & B, say) 
whose paths mapped to the same string, a string that is interpreted by 
a string-expecting system call to refer to B.  So references to A would 
wind up (in system call) affecting B instead. Is my reading correct?

john
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2169 bytes
Desc: not available
URL: <http://lists.racket-lang.org/users/archive/attachments/20041019/81adc7b2/attachment.p7s>

Posted on the users mailing list.