Platform independent pathnames
[email protected] (James Taylor) Sat, 3 Feb 2001 14:52:22 +0000 (GMT)
| Newsgroups | perl.riscos |
|---|---|
| Message-ID | <[email protected]> |
Hi all, I'm writing a Perl program to take a directory containing a website in a kind of "source" form and then (via various template files and automatic hierarchic navbar creation) to output a directory containing the complete site ready for upload. A major part of the program is that it has to calculate relative paths between all the pages, the graphics, and the navbar items, making sure that they are written into the HTML in the standard Unix format. At the same time it has to know where all the source and destination files are by native absolute pathname, and be able to convert between the two freely. The program will run on RISC OS during the initial development of sites, but then I also wish to be able to give it to my clients so that they can update their sites themselves - and they could be running Windows, Linux, MacOS or anything else. Obviously Perl is nicely portable, but I have a problem with how to perform all the pathname manipulations and conversions in a platform independent manner. It's rather a headache and your assistance would be much appreciated. 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. I'd like to have this program written by Monday morning, but right now I don't know where to start, because the treatment of pathnames is so central to the whole thing. Can someone please explain to me what I need to know. Thanks. -- James Taylor <james (at) oakseed demon co uk> Based in Hammersmith, London, UK. PGP key available ID: 3FBE1BF9 Fingerprint: F19D803624ED6FE8 370045159F66FD02