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

Re: [MacPerl] Converting From Unix to Mac



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

At 7:57 PM -0800 2/16/98, Brian "L." Matthews wrote:

}
} |On a simpler concept, I am working on hiding path problems by using a
} |variable for the path deliminator, and setting the variable based upon
} |environment variables.
}
} For a general purpose module, this would be necessary but not
} sufficient. For example, a////b on Unix is very different from a::::b
} on a Mac. And what does a path of / mean on a Mac? And I'd expect
} a Homogeneous.pm to "do the right thing" with paths like /dev/tty or
} /tmp/xxx.

Exactly.  My own thinking along these lines has been something like

$relative = Path::relative("MacPerl","lib");
$absolute = Path::absolute("usr","local","bin","perl");

with reverse routines that parse platform specific paths as well.  You
can't use ".." as up; the safest would be to use undef.  You've got to
reconcile Unix's "anything but a /" with Mac "anything but a :".  You've
got to guard against names that are too long, you've got to allow "." and
".." as plain file/directory names on anything but Unix  (and I don't mean
converting them to ":" and "::"; "." and ".." are legal names).  I could
write these for Unix/Mac pretty quickly, but now add in *all* the other
operating systems that Perl runs on.

The join(":",split("/")) works ok for the typical path, but if you're going
to "write and forget" conversion routines, you'd better guard against all
the atypical cases as well.  Recently on the Alpha list it was discovered
that Alpha simply wouldn't work right if there were "funny" characters in
the names of folders in the path.s (I don't remember at the moment, but I
think it was funny characters in the absolute path, which means that you
can break Alpha simply by moving it.)  This must be a Tcl limitation, but I
consider it a serious bug.  In as much as possible, Mac users should be
free to name their files/folders what they want to.

}
} Brian
}
} ***** Want to unsubscribe from this list?
} ***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch



- -----
Paul J. Schinder
schinder@pobox.com


-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBNOmUYlZaVc52j0XhEQJQVACg7ZVwdiuyp2IHsoBDU5ORpbMKPowAnRmo
/zzuZQTyR0d15PriOrkboPIR
=9k77
-----END PGP SIGNATURE-----


***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch