John E. Malmberg wrote:

[...]

One issue is that the VMS specific File::Spec routines should never be calling vmsify() or unixify(). These routines are not reversible, even if they make some cases of parsing more convenient, there are a number of VMS path specifications that can not make the round trip intact.

If I remember my VMS, This happens when a directory hangs of a logical thingy, to get around the eight depth limit? Such as

  sys$foo:[a.b.c]def.ghi;2

unixified might give

  /usr/sys/foo/bar/rat/baz/a/b/c/def.ghi

and when vmsified you might not get back the right version and in any event [usr.sys.foo.bar.rat.baz.a.b.c] overflows what a legal path may be?

[...]

What is needed is a routine or regex that converts such a path name to a format acceptable for VMS ODS-2 volumes, that is replacing the "."s with an "_".

Some where along the line a similar routine will likely be needed to covert things like foo.bar.xyz to foo_bar.xyz.

[...]

Any suggestions or help would be appreciated, particularly with algorithms to handle the conversion of paths and filenames with multiple dots (or other characters not in [A-Z][0-9][\-\_] in them.

I don't know what the rules are for paths, but your filename munging would look like

    $filename =~ s/[0-9A-Z_-](?=.*?\.)/_/g;

(specifically avoiding \d, \w re: utf-8 matching)

HTH,
David

Reply via email to