Paul Marquess wrote:
From: John E. Malmberg [mailto:[EMAIL PROTECTED]


Did you have to make any changes to globmapper.t? It passes "./" to glob and
it uses "[]" to mean a character class, not a VMS directory.

No, but I have made a note on my personal TO DO list about that.

What is needed is some methods to be used consistently internally and externally for filename classifications, as currently there are several different rules that are being applied in the VMS conversions depending on where you are.

As most of them do not know about VMS extended filenames, they really all will need updating, so I might as well make them common, and document the rules.

What I was looking at is methods named something like the following:

   is_vms_pathname(),
   is_unix_pathname()

   And more generic aliases:

   is_perl_pathname() same as is_unix_pathname()

   is_host_pathname() map to is_vms_pathname() on VMS,
   default to is_unix_pathname() if not overridden.

The possible return values are a little tricky as there are three possibilities:

   0 - is not for sure.
   1 - Maybe, but can not tell for sure.
   2 - is definitely.

With those methods, then foo[xyz] would not be confusing to Perl on VMS.

Currently the rules I plan to implement are and in this order:

Is not VMS filename if "/" is present with out a preceding "^".

Is VMS if "::" is present but not preceded by any other punctuation character, but preceded by alpha numeric.

The double "::" must be end of string, or followed by one of "^[<.;$" or an alpha-numeric character.

Is VMS if ":" is present but not preceded by any other punctuation except the "::" rule above.

The double "::" must be end of string, or followed by one of "^[<.;$" or an alpha-numeric character.

Is VMS if "[" or "<" is at the beginning of the string or immediately following one of the ":" rules above.

Is VMS if a "^" is present and EFS character sets are enabled.
Is VMS if a ";" is present.

If VMS is in a UNIX report mode: "." and ".." are treated as UNIX directories and the VMS files [].; or "[]^." are invisible.

If the name has no directory punctuation for either type, then it is ambiguous.

I am also thinking of assuming that a trailing "." indicates VMS because trailing "." is significant on VMS and suppressed on UNIX.

Of course a pathname with no punctuation could also be a VMS logical name.

And if the SYS$PARSE() system service fails on the name, it will be presumed not VMS.

As a full check could take significant resources, it may be desired to take shortcuts. The problem is that the glob() issue exposed what happens if shortcuts are taken.

The big difference between globmapper.t and 16oneshot.t is that all tests in
globmapper will use csh_glob whilst the tests in 16oneshot will trigger both
glob and csh_glob.

Does VMS use File::Glob behind the scenes for glob like Unix-land?

I do not know for sure.  I think it uses a special one in doio.c.

-John
[EMAIL PROTECTED]
Personal Opinion Only

Reply via email to