Subject: | rel2abs fails to check the current working directory inside a forked process under Win32 |
Hi,
rel2abs fails to check the current working directory when called within
a forked Win32 process.
Here is a buggy program:
#!perl -wl
use strict;
use File::Spec;
use Cwd;
my $localName = 'test_dir\test_file';
my $pid = fork;
# Buggy when $pid == 0 and works as expected when $pid != 0
if ($pid == 0) {
print getcwd; # Output: C:/dev
chdir 'C:/temp';
print getcwd; # Output: C:/temp
print File::Spec->rel2abs($localName);
# Output: C:\dev\test_dir\test_file
# The output of rel2abs should have been: C:\temp\test_dir\test_file
}
It works as expected in Linux. Hope you will look into it.
Regards,
Alan Haggai Alavi.
--
The difference makes the difference