Branch: refs/heads/blead
  Home:   https://github.com/Perl/perl5
  Commit: 643108fc9c03734b07078581bf534a62c1d2e597
      
https://github.com/Perl/perl5/commit/643108fc9c03734b07078581bf534a62c1d2e597
  Author: Lukas Mai <lukasmai....@gmail.com>
  Date:   2024-05-17 (Fri, 17 May 2024)

  Changed paths:
    M pod/perlfunc.pod

  Log Message:
  -----------
  perlfunc/stat: fix description of S_ENFMT and S_IFMT

S_ENFMT properly belongs to the group of permission bits (like
setuid/setgid), not file types. On systems that have it (like AIX), it
can be set/cleared with chmod(). (In fact, it usually shares its value
with S_ISGID because enforced locking is signaled by the combination of
a non-executable file with the setgid bit set.)

S_IFMT($mode) directly gives you one of the file types (S_IFREG,
S_IFDIR, etc). You don't need to bit-and it further (especially not with
the S_IS* functions), contrary to what the comment claims. (The
confusion likely stems from the C side of things, where you'd do `mode &
S_IFMT` to extract the file type from the mode bits, leading to code
like `(mode & S_IFMT) == S_IFDIR`. But even then you could write
`S_ISDIR(mode)` without any bit mask trickery.)

Most of the symbols in the "S_IF* constants" section don't start with
"S_IF", so change to "S_I* constants" everywhere.

Most of the symbols in the "S_IF* functions" section don't start with
"S_IF" (with the sole exception of S_IFMT, which is only a function in
Perl; the C macro is a constant).
(Historical note: This section label used to make more sense because it
documented S_IFMODE and S_IFMT functions, but the former was just a typo
for S_IMODE.)



To unsubscribe from these emails, change your notification settings at 
https://github.com/Perl/perl5/settings/notifications

Reply via email to