On Sat, Feb 03, 2001 at 02:52:22PM +0000, James Taylor wrote:
> I've had a look at File::Spec and children but do not seem to be able
> to get it to work. I'm also confused by the automatic format conversion
> the the RISC OS port does on pathnames. In a way this should make it
> easier, but because I'm in a state of doubt already, I am starting to
> doubt my understanding of the automatic conversion behaviour and scope.
> Specific problems I've had are in the use of File::Spec->canonpath()
> which does not seem to perform the tidying operations it promises.

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
   [but I seem to remember writing it. mainly memories of fun and games
    with trying to cope with &RISCOS::Filespec::convert maybe not being
    defied, so that it would work equally well not on RISC OS]
   The only thing I can't check is my backup IDE disc that's 3 miles away
   (and in a jiffy bag not a computer) but it's looking depressingly like
   I may have deleted all copies. Bah.

This would suggest that to use File::Spec you'll need to be in "conversion"
mode. (the default, as you stated)

The canonicalise stuff does

  convert to RISC OS format if conversions are on
run through the OS_FSControl to canonicalise
  convert back to Unix if conversion are on

which may cause "fun and games" if you feed in something like
"foo/html"

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

Nicholas Clark

Reply via email to