```{index} single: s_imode; Fcntl function ``` ```{index} single: Fcntl::s_imode; Perl function ``` # 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, returns `0`. ## Examples ```perl use Fcntl qw(:mode); my $mode = (stat $path)[2]; printf "perms = %04o\n", S_IMODE($mode); # perms = 0644 ```