httpd-test-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <s...@stason.org>
Subject Re: Apache::TestMM::generate_script vs. Win32 Paths
Date Thu, 19 Feb 2004 03:34:49 GMT
Randy Kobes wrote:
Thanks for testing, Randy

>>+        for my $key (keys %conf_opts) {
>>+            next unless Apache::TestConfig::conf_opt_is_a_filepath($key);
>>+            $conf_opts{$key} = Win32::GetShortPathName($conf_opts{$key});
> 
>                                   ^^^^^^^^^^^^^^^^^^^^^^^
> I think if one calls Win32::GetShortPathName
> on something that has no short path name, then
> nothing is returned. For example,
> ======================================================
> use strict;
> use warnings;
> for ('C:\Program Files', 'C:\ProgramFiles') {
>     my $x = Win32::GetShortPathName($_);
>     if ($x) {
>         print "$_ has a short name of $x\n";
>     }
>     else {
>         print "$_ has no short name\n";
>     }
> }
> =======================================================
> prints
> =======================================================
> C:\Program Files has a short name of C:\PROGRA~1
> C:\ProgramFiles has no short name
> ========================================================
> 
> Thus, the above should probably include
> 
> 
>>+        for my $key (keys %conf_opts) {
>>+            next unless Apache::TestConfig::conf_opt_is_a_filepath($key);
>>+ +          next unless $conf_opts{$key} =~ / /;
>>+            $conf_opts{$key} = Win32::GetShortPathName($conf_opts{$key});

ay, that's so incredibly <place your favorite swear word here>. there is no a 
core function that will take any given path and return a usable path?

do you need to run this transform only if /\s/? What about long names (>8.3), 
don't they have short names too?

For god's sake, can someone patch File::Spec to handle that win32 ridicule? 
Just think how much time every project wastes to deal with the same issues, 
again and again if they need to work with win32... not talking about making 
the source code cluttered with unneeded noise. that's just disgusting.

Shouldn't canonfile() know how to deal with this GetShortPathName thingy?

/of course none of these "flattering" comments are directed at Randy and other 
brave and helpful folks ;)/

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

Mime
View raw message