Re: Platform independent pathnames
[email protected] (James Taylor) Sat, 3 Feb 2001 19:47:23 +0000 (GMT)
| Newsgroups | perl.riscos |
|---|---|
| Message-ID | <[email protected]> |
In <URL:news:local.riscos-perl> on Sat 03 Feb, Nicholas Clark wrote: > > Aagh. In File::Spec I find references to RISCOS::File::Spec but > 1: it's buggy ($^O is "riscos", not "RISCOS") > 2: I can't find a copy anywhere of RISCOS::File::Spec Whoops! :-( > This would suggest that to use File::Spec you'll need to be in "conversion" > mode. (the default, as you stated) Yes, not only that, but I would also like to write a single script that need not know about any platform, but which is platform independent. This is why I was looking at File::Spec and friends because I was hoping that I could do Unix pathnames in File::Spec::Unix for the HTML embedded paths, and native pathname stuff using File::Spec whatever platform the script was running on. Although, when I read the File::Spec docs there didn't seem to be an easy way to convert back and forth between native and Unix format. > How to turn the conversion on and off is documented in RISCOS::FileSpec, > which will be in !Perl.riscos.RISCOS.FileSpec/pm > by default use RISCOS; or use RISCOS::FileSpec; will turn the conversion > off. (which may seem mad, but the intent was a script knowing it wanted to > run on RISC OS would likely start > > #!perl -w > use RISCOS; > > and at that point conversions are off. Whereas a written-for-unix script > with hardwired '/' directory separators and no idea of "use RISCOS;" will > (should) just work Yes, I see the motivation. I've tried reading the RISCOS::FileSpec documentation but get very confused when it starts to talk about all the different cases under which it does certain things. I decided to steer well clear of platform specific modules and write something that would work without needing to know what platform it was running on. Unfortunately, this does not seem to be possible. I'll try asking the folks on comp.lang.perl.misc it's just that they won't be aware of problems that might exists in the RISC OS version's implementation of supposedly platform independent modules. -- James Taylor <james (at) oakseed demon co uk> Based in Hammersmith, London, UK. PGP key available ID: 3FBE1BF9 Fingerprint: F19D803624ED6FE8 370045159F66FD02