On 02 Oct 2007, at 14:49, John E. Malmberg wrote:
After encountering this again in the Module Build tests, I think it
may be better to let VMS:::Filespec::vmsify do the translation, as
it knows when to change the dots to underscores.
I like this idea, and it's not hard to implement generically in
C::I::Utils->_safe_path,
where we do pathname fixes for Win32 already.
One question though:
It is a three step procedure:
1. Make sure that the value to be converted, $pkg_namver is in UNIX
directory syntax by appending a '/' to it.
2. Use VMS::Filespec::vmsify($pkg_namver . '/') to convert the dots
to underscores if needed. The trailing '/' is needed as so that
C<vmsify> knows that it should use directory translation instead of
filename translation, as filename translation leaves one dot.
3. Use $pkg_namver =
File::Spec->splitdir(VMS::Filespec::vmsify($pkg_namver . '/') if
$^O eq 'VMS'; to get remove the directory delimiters.
splitdir() returns an array -- from a generic path, being either /
dir/ or /dir/file, what would
be the right way to get the 'proper' path back? Do we use catfile()?
Thanks,
--
Jos Boumans
How do I prove I'm not crazy to people who are?