Hi,
We are a multi-platform development site, and part of our build system uses a combination of File::Spec::canonpath and File::Spec::catfile to correctly arrange a network path.
This code has broken with Win7/WinServer2008.
It can be easily demonstrated.
use File::Spec;
$bif_path = "/foo/go/do";
$bif_path = File::Spec->canonpath ($bif_path);
print "canonpath: $bif_path\n";
$bif_path = File::Spec->catfile ('', $bif_path);
print "catfile: $bif_path\n";
On WINXP and previous Win versions the path is converted to
"\\foo\go\do"
However, on Win7, the string is returned as
"\foo\go\do"
The single "\" reference fails on Win7, it still needs to be "\\".
Following the code in the debugger, it appears the "\\" is stripped by line 397 of "_canon_cat" for "performance."
Has anyone else bumped into this?
I am wondering if it is Perl or something to do with the network path being treated as local?
Or, have we been doing this as a convenience and it shouldn't have been written in this manner in the first place?
No idea.
Any help greatly appreciated.
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.