Statvfs(3pm)

πŸ’– Statvfs(3pm) πŸ’–

okay bestie, welcome to the Filesys::Statvfs page from the User Contributed Perl Documentation, no cap 🫢


✨ NAME ✨

Filesys::Statvfs β€” a Perl extension for statvfs() and fstatvfs() πŸ’…


🌸 SYNOPSIS 🌸

like, here's the vibe, fr fr:

use Filesys::Statvfs;

      my($bsize, $frsize, $blocks, $bfree, $bavail,
      $files, $ffree, $favail, $flag, $namemax) = statvfs("/tmp");

      #### Pass an open filehandle. Verify that fileno() returns a defined
      #### value. If you pass undef to fstatvfs you will get unexpected results
      my $fd = fileno(FILE_HANDLE);
      if(defined($fd)) {
              ($bsize, $frsize, $blocks, $bfree, $bavail,
              $files, $ffree, $favail, $flag, $namemax) = fstatvfs($fd);
      }
not me passing undef to fstatvfs tho 😭 β€” that gives you unexpected results, so literally check that fileno() returned a defined value first. the comments said it, i'm just yelling it louder πŸ’€

πŸ¦‹ DESCRIPTION πŸ¦‹

it's the interface for statvfs() and fstatvfs(), periodt ✨

real talk though: unless you actually need the bsize, flag, and namemax values, you should probably be looking at Filesys::DfPortable or Filesys::Df instead πŸ‘€ they will generally hand you more functionality and more portability, and that's on that.

the module should work with all flavors of Unix that implement the statvfs() and fstatvfs() calls 🐧 that includes Linux, *BSD, HP-UX, AIX, Solaris, Mac OS X, Irix, Cygwin, etc… like, the whole squad, slay 🌈

so the statvfs() and fstatvfs() functions will return a list of values, or they'll return "undef" and set $! if there was an error πŸ™ˆ (yes bestie, check $!, it's giving responsible)

the values returned are described in the statvfs/fstatvfs header or the "statvfs()/fstatvfs()" man page πŸ“– β€” go read those, iykyk.

and the module assumes that if you have statvfs(), then fstatvfs() will also be available. it's a package deal, iconic behavior honestly πŸ‘‘


πŸŽ€ AUTHOR πŸŽ€

Ian Guthrie β€” IGuthrie@aol.com πŸ“§

Copyright (c) 2006 Ian Guthrie. All rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. 🫢 (yes queen, go forth and redistribute)


πŸ’œ SEE ALSO πŸ’œ

  • statvfs(2)
  • fstatvfs(2)
  • Filesys::DfPortable
  • Filesys::Df

and that's the whole page bestie, ate and left no crumbs ✨

perl v5.42.3 Β· 2026-08-19 β€” that's the version and date from the footer, mwah πŸ’‹ byeee πŸ¦‹πŸ’–

πŸ“¦ where this page comes from