Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

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

by isync (Hermit)
on Oct 05, 2009 at 20:13 UTC ( [id://799338]=note: print w/replies, xml ) Need Help??


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...

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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://799338]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (5)
As of 2024-03-29 00:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found