```{index} single: S_IMODE (Fcntl) ``` ```{index} single: Fcntl::S_IMODE ``` # S_IMODE Extract the permission bits from a stat-mode value. ## Synopsis ```perl my $perm = S_IMODE($mode); ``` Returns `$mode & 07777` - the nine permission bits plus the setuid, setgid, and sticky bits. Strips the file-type bits that `S_IFMT` would keep. With no argument, warns "Use of uninitialized value" and returns `0`. ## Examples ```perl use Fcntl qw(:mode); my $mode = (stat $path)[2]; printf "perms = %04o\n", S_IMODE($mode); # perms = 0644 ```