Subject: | CPAN ncftpget call fails for different volumes (Win32) |
The C<cpan> program fails when using C<ncftpget> to download a file if the current directory is on a different volume than the target directory on Win32. This is because the C<cd> command does not change the current volume in the Win32 shell.
The fix is to patch CPAN.pm as follows to insert the '/d' switch for C<cmd.exe>:
if ($f eq "ncftpget"){
my $volume = ($^O =~ /win32/i and $ENV{COMSPEC} =~ /cmd\.exe$/i) ? '/d ' : '';
$chdir = "cd $volume $aslocal_dir && ";
$stdout_redir = "";
}
This patch only works for the NT-based versions, as the good ol' C<COMMAND.COM> does not understand the C</d> switch at all.