Filesy...kSpace(3pm)
π Filesys::DiskSpace(3pm) β the Perl df, bestie edition π
okay so this page is from the User Contributed Perl Documentation section of the manual, and it's literally just... df, but in Perl. that's the whole vibe. it's giving "i just want to know how full my disk is" and honestly? valid. β¨
πΈ NAME πΈ
Filesys::DiskSpace β Perl df
like. that's it. that's the name. short, sweet, iconic. π
π¦ SYNOPSIS π¦
use Filesys::DiskSpace;
($fs_type, $fs_desc, $used, $avail, $fused, $favail) = df $dir;
so you use it, you call df on a directory, and boom β six values come back at you. no cap. π
β¨ DESCRIPTION β¨
this routine shows you info about a file system: its type, how much disk space is being occupied, the total disk space, and the number of inodes. so basically everything you'd want to know before you start panicking about storage. π
it tries syscall(SYS_statfs) and syscall(SYS_statvfs) in several ways β like, it's gonna really try, okay? it's doing the work.
and if all of that fails? itcroaks. π not a whisper, not a polite return value β a full-oncroak. respect.
π OPTIONS π
these are the things it hands back to you. one bullet per value, no skipping, we're thorough in this house:
$fs_typeβ [number] the type of the filesystem.$fs_descβ [string] the description of this fs.$usedβ [number] the size used, in Kb.$availβ [number] the size available, in Kb.$ffreeβ [number] the free inodes.$fusedβ [number] the inodes used.
(and yeah bestie, the list says $ffree while the SYNOPSIS calls it $favail β i am not touching that, i report, i don't fix. π)
π§ Installation π§
go look at the INSTALL file. that's where the tea is. πβ¨
π COPYRIGHT π
Copyright (c) 1996-1999 Fabien Tassin. All rights reserved.
this program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. slay. π«Ά
π AUTHOR π
Fabien Tassin <fta+cpan@sofaraway.org>
the main character who made this whole thing happen. we stan. π
π NOTES π
okay so some lore: this module was formerly called File::Df. it got renamed to Filesys::DiskSpace. and get this β it could have been Filesys::Df, but unfortunately another module made in the meantime already took that name. so. here we are. the name drama was real. π
Tested with Perl 5.003 under these systems:
- Solaris 2.[4/5]
- SunOS 4.1.[2/3/4]
- HP-UX 9.05, 10.[1/20] (see below)
- OSF1 3.2, 4.0
- Linux 2.0.*, 2.2.*
look at that list. retro. vintage. nostalgic in a "why are we like this" way. π
π Note for HP-UX users π
if you get this message:
"Undefined subroutine &main::SYS_statfs called at Filesys/DiskSpace.pm
line XXX"
and you're on a hp9000s700, then here's the move: edit the syscall.ph file (it lives in the Perl lib tree) and copy the line containing SYS_statfs {196;} outside the if (defined &__hp9000s800) block β that's around line 356.
lowkey a manual patch situation, but it's what the docs say, so it's what we say. π
that's the whole page, bestie. everything accounted for, nothing skipped, no crumbs left behind. π¦
perl v5.32.0 Β· 2021-01-03 Β· and that's the version + date stamp from the footer, mwah. π go check your disk space, periodt. β¨
π¦ where this page comes from
- debian bookworm: libfilesys-diskspace-perl 0.05-16+nmu2.1 Β· GPL
- debian trixie: libfilesys-diskspace-perl 0.05-16+nmu2.1 Β· GPL
- ubuntu jammy: libfilesys-diskspace-perl 0.05-16+nmu2.1 Β· GPL
- ubuntu noble: libfilesys-diskspace-perl 0.05-16+nmu2.1 Β· GPL
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms