in reply to Re^6: File::Spec::Win32 returning different result than File::Spec when doing catfile with empty string
in thread File::Spec::Win32 returning different result than File::Spec when doing catfile with empty string

While I would argue that the inheritance tree of File::Spec is not an internal detail because it is documented, you are right: File::Spec is intended for filename handling, and checking the style of filenames in use does not reliably identify *nix systems because several Perl ports translate Unix-style filenames to the native format.

For the release that I am calling "alpha-5" for short, I am using this code:

BEGIN { use constant (); my $have_valid_inodes = 0; # We accept DEV:INO as valid if two files in the same directory have + the # same DEV and different INO values. We use two modules from this # library for this test and retrieve their actual locations from %I +NC. my @stat_record = stat $INC{'WARC/Record.pm'}; my @stat_volume = stat $INC{'WARC/Volume.pm'}; $have_valid_inodes = 1 if (scalar @stat_record && scalar @stat_volume # both stat calls w +orked && $stat_record[0] == $stat_volume[0] # both have same DEV && $stat_record[1] != $stat_volume[1]); # different INO valu +es constant->import(HAVE_VALID_INODES => $have_valid_inodes); }

What makes this particularly "interesting" is that all of the CPAN smoketest boxes seem to be running various *nix systems.

  • Comment on Re^7: File::Spec::Win32 returning different result than File::Spec when doing catfile with empty string
  • Select or Download Code