Unix::S...fs_stats(3)

πŸ“¦ version 0.112, in fedora 43

✨ Unix::S...fs_stats(3) ✨

okay bestie, pull up a chair 🫢 this is a User Contributed Perl Documentation page, and it's literally just the whole rundown on Unix::S...fs_stats(3). no cap, it's giving "container energy". let's go πŸ’…


🌸 NAME 🌸

Unix::Statgrab::sg_fs_stats β€” a container for libstatgrab filesystem statistics. it's the lil box where all your fs numbers live πŸ“¦βœ¨


πŸ¦‹ DESCRIPTION πŸ¦‹

Unix::Statgrab::sg_fs_stats is a Perl package name that hands you accessors to the bundled libstatgrab sg_fs_stats filesystem statistics πŸ’–

the docs for that live over at http://www.i-scream.org/libstatgrab/docs/sg_get_fs_stats.3.html β€” iykyk, go peek if you want the deep lore πŸ‘‘


πŸŽ€ METHODS πŸŽ€

nentries

returns the number of entries in the container. that's it, that's the whole vibe. count 'em πŸ”’

systime

returns the seconds since Epoch β€” which is 0:00:00 on January, 1st 1970, for the record β€” of the time measure the filesystem statistics. so it's the timestamp of when the stats were taken ⏰

as_list

Deprecated alias of fetchall_hash ⚠️ like, it still exists, but it's the old way. use fetchall_hash, bestie.

fetchall_hash

returns all records from the sg_fs_stats container as a list of hash, where each datum name is the key and the datum is the value πŸ—‚οΈ (link: http://www.i-scream.org/libstatgrab/docs/sg_get_fs_stats.3.html)

fetchall_array

returns all records from the sg_fs_stats container as a list of arrays, with the values in this exact order πŸ“‹ (link: http://www.i-scream.org/libstatgrab/docs/sg_get_fs_stats.3.html):

(device_name fs_type mnt_point device_type size used free avail
 total_inodes used_inodes free_inodes avail_inodes
 io_size block_size
 total_blocks used_blocks free_blocks avail_blocks
 systime)

in that order, without leading headline. no header row, we're going straight in πŸ’…

fetchall_table

returns all records from the sg_fs_stats container as a list of arrays, same order as above πŸ“‹ (link: http://www.i-scream.org/libstatgrab/docs/sg_get_fs_stats.3.html):

(device_name fs_type mnt_point device_type size used free avail
 total_inodes used_inodes free_inodes avail_inodes
 io_size block_size
 total_blocks used_blocks free_blocks avail_blocks
 systime)

in that order, including leading headline. so this one DOES come with the header, okay bestie, that's the difference ✨

fetchrow_arrayref($row = 0)

returns one row as an array, containing values as above. defaults to row 0 if you don't pass anything 🎯

fetchall_arrayref

returns all records from the sg_fs_stats container as an array of arrays, without header πŸ™ˆ (link: http://www.i-scream.org/libstatgrab/docs/sg_get_fs_stats.3.html)

fetchrow_hashref($row = 0)

returns one row as a hash containing { device_name => $self.device_name($row), fs_type => ... } πŸ“ defaults to row 0.

fetchall_hashref

returns all records from the sg_fs_stats container as an array of hashes πŸ’œ (link: http://www.i-scream.org/libstatgrab/docs/sg_get_fs_stats.3.html)

colnames

returns the list of column names, and here they are, all of them, in order:

(device_name fs_type mnt_point device_type size used free avail total_inodes used_inodes free_inodes avail_inodes io_size block_size total_blocks used_blocks free_blocks avail_blocks systime)

slay, that's the whole lineup πŸ‘‘


and now for the accessors, the main characters themselves 🌈

  • device_name β€” Name of the device the filesystem statistics belong to
  • device_canonical β€” Canonical name of the device the filesystem statistics belong to
  • fs_type β€” Filesystem type (as string), e.g. zfs
  • mnt_point β€” Path name of mount point for the file system
  • device_type β€” Bitwise combination of sg_fs_regular sg_fs_special sg_fs_loopback sg_fs_remote, usually one of
  • size β€” Size of filesystem, in bytes
  • used β€” Used bytes of filesystem
  • free β€” Free bytes in filesystem
  • avail β€” Available bytes in filesystem (free - reserved)
  • total_inodes β€” Total number of inodes in filesystem
  • used_inodes β€” Used number of inodes in filesystem
  • free_inodes β€” Free number of inodes in filesystem
  • avail_inodes β€” Available inodes in filesystem (free - reserved)
  • io_size β€” Optimal size for I/O for this filesystem in bytes
  • block_size β€” Size of blocks in bytes
  • total_blocks β€” Total number of blocks in filesystem
  • used_blocks β€” Used number of blocks in filesystem
  • free_blocks β€” Free number of blocks in filesystem
  • avail_blocks β€” Available blocks in filesystem (free - reserved)

get_fs_stats_diff

gives you the difference between the last measurement and the recent one πŸ”₯ so you can see what changed between then and now:

$recent->get_fs_stats_diff($last);

⭐ CONSTANTS ⭐

here's the whole squad of constants, no notes:

sg_fs_unknown sg_fs_regular sg_fs_special sg_fs_loopback sg_fs_remote
sg_fs_local sg_fs_alltypes

πŸ’œ AUTHOR πŸ’œ

Jens Rehsack, <rehsack AT cpan.org> β€” shoutout to the icon who wrote this πŸ‘‘


Copyright (C) 2012-2018 by Jens Rehsack

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

fr fr, that's the actual license text, don't skip it πŸ’–

and that's the whole page bestie, we ate and left no crumbs πŸ’…βœ¨ this was perl v5.42.0, dated 2025-07-25, and the page is Unix::S...fs_stats(3) β€” catch you on the next man page πŸ¦‹πŸŽ€

πŸ“¦ where this page comes from