in reply to POSIX::S_ISDIR() with $stat->mode values from Windows vs. Linux

Slap on the forehead!!
This monk begs your pardon...

I've found the cause for this strange behavior, the issue that the "dir-test" broke when running on Debian - this line:
my $attr = int($mode) == 16895 ? FILE_ATTRIBUTE_DIRECTORY : FILE_ATTRI +BUTE_NORMAL;
An old dirty hack more down my code, where I forgot about it. A line which in a stupid way testes against the two Win32-cases of dir/file... Works on Windows, but can't handle the richer responses from the Debian platform fs.

Thank you very much for the lecture everyone.
And for the monks who feel I wasted their time: they might take comfort from the fact that I, while this thread grew, went through possibly every iteration of oct(), hex(), sprintf("%5o",$mode), $isdir =~ /^40/, there is...
  • Comment on Re: POSIX::S_ISDIR() with $stat->mode values from Windows vs. Linux
  • Download Code

Replies are listed 'Best First'.
Re^2: POSIX::S_ISDIR() with $stat->mode values from Windows vs. Linux
by jakobi (Pilgrim) on Oct 05, 2009 at 20:50 UTC

    :)

    One more thing to check given NTFS: are you certain that a native windows Perl will _ALWAYS_ see just those 2 values. Say on a host with 2 user accounts... .

      I thought of that, but at least on my XP box it seems to be just those two.
      Anyway, as I threw out this line and check with POSIX::S_ISDIR() solely, I am on the safe side, I think.