There is some strange behavior on File::Spec->catfile on VMS
(perl, v5.8.1 built for VMS_AXP)
Whenever my path length is a multiple of 8 + 1 (or a multiple of 8+3 if you count the brackets), e.g. 9, 17, 23, the path is formed incorrectly (as shown below). It discards the second argument and forms a file path based on the first argument only.
my $path = "[DIR.";
my $tmp = "";
for(my $x=0; $x<60; $x++) {
$tmp .= "a";
my $tmp2 = $path . $tmp . "]";
print File::Spec->catfile($tmp2, "file") . "\n";
}
-----------------------------
$ perl test.pl
USERS:[DIR.a]file
USERS:[DIR.aa]file
USERS:[DIR.aaa]file
USERS:[DIR.aaaa]file
USERS:[DIR]aaaaa
USERS:[DIR.aaaaaa]file
USERS:[DIR.aaaaaaa]file
USERS:[DIR.aaaaaaaa]file
USERS:[DIR.aaaaaaaaa]file
USERS:[DIR.aaaaaaaaaa]file
USERS:[DIR.aaaaaaaaaaa]file
USERS:[DIR.aaaaaaaaaaaa]file
USERS:[DIR]aaaaaaaaaaaaa
USERS:[DIR.aaaaaaaaaaaaaa]file
USERS:[DIR.aaaaaaaaaaaaaaa]file
USERS:[DIR.aaaaaaaaaaaaaaaa]file
I haven't been able to find anything through SuperSearch, google, cpan, etc related to this "bug". Does anyone have any idea what's going on? The next step will be to step through the Spec::File code, likely somewhere in the vmsify function or a child of it since this does not happen on UNIX.
Also, I have the latest version of File::Spec and File::Spec::VMS.
Any thoughts?
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.