in reply to POSIX::S_ISDIR() with $stat->mode values from Windows vs. Linux
Those extra octets with (stat())[2] are filetype, sticky bit and others (or as you pose the question exactly the other way: the lower bits are the standard permission bits). Just mask them with and (and please consider using octals for readability, 33206 is more an illness than anything else).
If you've access to a unix box: man 2 stat; man 3 stat.
As you do have access to an ubuntu box: consider grepping the compiler includes (struct stat, field mode_t), they're authorative and quite often eye-opening (even if they tend to be in that wrong, lower language called C. Still that and the syscalls are the base for Perl).
:)
Peter
PS: missing is e.g. this
ls -ld . -> drwxr-xr-x 187 jakobi jakobi 16384 2009-10-05 18:56 .
which are the lower bits in the stat call.
ignore the leftmost d for now, and you've the 3*3 perm bits for user, group and other. Which probably are the bits accounting for most of the windows to linux difference in stat output. (please also ignore the output overload of the ls command, which just has to abose the x bit for things like hinting at the setgid or setuid bit, and worse - that's doesn't have anything to do with the bitfield from stat()). The 'd' from ls is used for a filetype of a dir, as with the test commands of test -d in the shell or Perl's -d. And this filetype is encoded in some of the higher bits returned by mask.
|
|---|