The documentation at http://h71000.www7.hp.com/doc/731final/documentation/pdf/ovms_731_file_app.pdf (section 5-1) says the filename should look like this:
node::device:[root.][directory-name]filename.type;version
Most of them are optional (like node, device, version) - not sure which ones and how to correctly write this in a regexp, (including the directory name):
DISK1:[MYROOT.][MYDIR]FILE.DAT
DISK1:[MYDIR]FILE.DAT
[MYDIR]FILE.DAT
FILE.DAT;10
NODE::DISK5:[REMOTE.ACCESS]FILE.DAT
See the documentation and source for the VMS::Filespec Perl module.
From wikipedia, the full form is actually a bit more than that:
NODE"accountname password"::device:[directory.subdirectory]filename.type;ver
This one took a while, but here is an expression that should accept all valid variations, and place the components into capture groups.
(?:(?:(?:([^\s:\[\]]+)(?:"([^\s"]+) ([^\s"]+)")?::)?([^\s:\[\]]+):)?\[([^\s:\[\]]+)\])?([^\s:\[\]\.]+)(\.[^\s:\[\];]+)?(;\d+)?
Also, from what I can tell, your example of
DISK1:[MYROOT.][MYDIR]FILE.DAT
is not a valid name. I believe only one pair of brackets are allowed. I hope this helps!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With