[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] Directory Divider (Was: "Epoch-m



Paul Schinder wrote:
>bob.dalgleish@sasknet.sk.ca (Bob Dalgleish) writes:
>} 2b) Replace File::basename.pl with an OO module that has constructors, and
>} parsers.
>}
>} Not knowing any better, I propose that the characters slash "/", backslash
>} "\", colon ":", left and right square bracket "[" and "]" be treated
>} specially for cross-platform purposes.
>
>No, I'm not sure I like this.  What I would prefer under MacPerl is
>that anything that is legal on a Mac won't have to be encoded, which
>means, essentially, that any name without : and less than 32 characters
>in length is legal and should be accepted by a basename or
>basename-like routine.  There should be no reserved characters other
>than those forbidden by the local OS.  This is straightforward on Macs
>and Unix (and I assume on DOS).  If you're doing cross platform work,
>you might want to teach it what's illegal on various platforms, and to
>tell it to encode characters illegal on that platform if the path would
>otherwise work but throw an error if it wouldn't, or something. But
>there shouldn't be any restrictions on the local character set or name
>length beside what already exist.

But isn't the whole idea of basename to be able to do cross-platform stuff?
I'd think that if you're doing cross-platform work you'd want to have some
package that lets you do cross-platform file names without having to
"teach" it anything. In that case, it seems to me that Bob's suggestion to
treat all those characters as special is reasonable (can't think of any way
around it). If you want to be able to use any legal Mac file name, then
you're not writing cross-platform code and presumably wouldn't use the
basename (or whatever) package ...

... am I missing something?

%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~%
|  Ray Zimmerman (rz10@cornell.edu)   |  "The number you have       |
|  428-B Phillips Hall                |    dialed is imaginary.     |
|  Cornell Univ., Ithaca, NY  14853   |   Rotate phone 90 degrees   |
|  607-255-9645  Fax: 607-254-4565    |    and try again."          |
%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~%