STATFILE(1)

πŸ“¦ version 2024.12.07, in nixpkgs unstable

πŸŽ€ STATFILE(1) πŸŽ€

okay bestie, welcome to the manual for statfile β€” full manual-name energy: the statfile program. ✨

🌈 SYNOPSIS 🌈

statfile -options file [command arg ...]

✨ DESCRIPTION ✨

So here's the tea: statfile calls stat() on file, sets the environment variables specified in options according to the stat information, and runs command. πŸ’–

If file begins with a digit, it's interpreted as a file descriptor, and passed to fstat(). 🫢

If command is not given, statfile exits zero, indicating that the stat() call was successful. No command? no problem β€” successful stat() flex. πŸ’…

The leading - in the options argument is not required. (Not required! optional! lowkey iconic.) ✨

Options are as follows:

πŸŽ€ OPTIONS πŸŽ€

  • l β€” call lstat() instead of stat()
  • d β€” set $DEV to the file's device number
  • i β€” set $INO to the file's inode number
  • t β€” set $TYPE to the file's type:
    • - for regular files
    • d for directories
    • l for symlinks
    • p for fifos
    • s for sockets
    • c for character devices
    • b for block devices
  • m β€” set $MODE to the file's permissions, in octal, e.g.: 01777. Also set each of the following to 1, or unset them, according to whether that bit is set in the permissions:
    • MODE_SUID
    • MODE_SGID
    • MODE_STICKY
    • MODE_RUSR
    • MODE_WUSR
    • MODE_XUSR
    • MODE_RGRP
    • MODE_WGRP
    • MODE_XGRP
    • MODE_ROTH
    • MODE_WOTH
    • MODE_XOTH
  • n β€” set $NLINK to the number of hard links to the file
  • u β€” set $UID to the file owner's uid
  • g β€” set $GID to the file group's gid
  • r β€” set $RDEV to the file's rdev number
  • s β€” set $SIZE to the file's size
  • S β€” set $BLKSIZE to the block size for this file
  • b β€” set $BLOCKS to the number of blocks for this file
  • A β€” set $ATIME to the file's last access time, as a decimal time_t value, and $ATAI64N to the corresponding TAI64N label, in hex
  • M β€” set $MTIME to the file's last modification time, as a decimal time_t value, and $MTAI64N to the corresponding TAI64N label, in hex
  • C β€” set $CTIME to the file's last inode change time, as a decimal time_t value, and $CTAI64N to the corresponding TAI64N label, in hex

πŸ’– that's the whole page, bestie β€” xoxo from the statfile program πŸŽ€

πŸ“¦ where this page comes from