Stat file

fs_stat

Portable 'stat' dispatcher that retrieves a single file attribute. Tries GNU stat (-c format), then BSD stat (-f format), then perl as a fallback.

Arguments

  • $1 (string): Attribute to retrieve: atime, ctime, mtime, size, or owner
  • $2 (string): Path to the target file

Exit codes

  • 0: Success

Output on stdout

  • Requested attribute value (epoch seconds for times, bytes for size, username for owner)

whoowns

Print the username of the owner of a file.

Arguments

  • $1 (string): Path to the file

Exit codes

  • 0: Success

Output on stdout

  • Username of the file owner

fs_file_age

Return how many seconds ago a file was last modified.

Arguments

  • $1 (string): Path to the file

Exit codes

  • 0: Success
  • 1: File does not exist or is unreadable

Output on stdout

  • Age of the file in seconds