1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512
|
di - disk information utility (version 4.18).
DESCRIPTION
'di' is a disk information utility, displaying everything
(and more) that your 'df' command does. It features the
ability to display your disk usage in whatever format you
desire/prefer/are used to. It is designed to be portable
across many platforms.
INSTALLATION
To build with mkconfig.sh:
./Build distclean
./Build
./Build install
Example to change compiler and prefix:
CC=gcc prefix=/opt/bin ./Build
For BeOS, Haiku:
CC=g++ ./Build
For Syllable:
CC=g++ ./Build -mkpl
To turn off NLS (internationalization):
./Build -nonls
To build with mkconfig.pl (requires perl):
./Build -mkpl
The CC, CFLAGS, prefix, LDFLAGS, and LIBS environment
variables may be set and exported prior to running make.
The LOCALEDIR environment variable may be set to the installation
directory for the locale files. Default is ${prefix}/share/locale.
The internationalization files are automatically installed if
your system supports internationalization.
[en_US: 27-Aug-2002, de_DE: 26-Feb-2004].
To force a 64 bit binary build:
./Build -64
Installation Permissions:
Some old systems (Sys V variants) only allow root to read the
mount table. If this is the case, change the INSTPERM macro
in the Makefile should be set to 4111, and the USER macro to root.
In SysV.4 and Solaris, the mount command would reset the
permissions to be root readable only (fixed in Solaris 7).
If this is needed on your system, do:
make installperms
Windows installation:
You may need to undefine _lib_GetDiskFreeSpaceEX
in the config.h file for older windows systems.
(1) and (2) will build using the windows API.
If you prefer to use the cygwin API rather than the
windows API, edit config.h, and undefine _hdr_windows,
_lib_GetDiskFreeSpace, _lib_GetDiskFreeSpaceEx,
_lib_GetDriveType, _lib_GetLogicalDriveStrings and
_lib_GetVolumeInformation, then re-run the build.
Alternative 1)
Cygnus gcc: make windows-gcc
MS VC++: nmake windows
Alternative 2)
./Build distclean
CC=gcc ./Build
REQUIREMENTS
bourne/ksh/bash shell
C compiler
make
features/cflags.sh:
uname sed grep
features/obj_ext.sh:
cat rm
mkconfig.sh:
a shell that supports shell functions
sort uniq cat rm sed grep
mkconfig.pl:
perl cat rm
NLS:
msgfmt sed
turnoffnls.sh:
ed
make install:
cp ln rm test
PORTING
di 4.18 has been tested on the following platforms:
CentOS 3.9, 4.8, 5.2, 5.3
Cygwin
Debian 4.0, 5.0, kFreeBSD 7.2
Fedora 5.2
FreeBSD 4.9, 7.0, 7.1, 7.2, 8.0
Haiku 1
HP-UX 11.11 (bundled cc, gcc)
MacOSX 8.11, 9.5
NetBSD 2.0.2, 4.0.1, 5.0.1
Nexenta 101_b85
OpenBSD 4.5
RedHat 7.3
Solaris 8, 9, 10 (cc, gcc3, gcc4)
Syllable 0.6.6
Ubuntu 9
di has been ported to the following systems in the past:
A/UX, AIX, BeOS, BSDI, Compaq Tru64, Convex, Cray UNICOS,
Cray UNICOS/mk, FreeBSD, Haiku, HP/UX, Linux, MacOS X,
NetBSD, Next, OpenBSD, OSF/1, Pyramid, SCO Unix,
Sequent Dynix and PT/x, SGI Irix, Solaris, SunOS, Syllable,
Sys V.3, Sys V.4, Ultrix, Windows, Xenix
BUGS
Send bug reports along with the output from 'di -A -a -X 5' and the
output from your standard df command (as verbose as possible) to:
bll6969di_at_gmail.com
If the Build script doesn't set up the 'config.h'
file correctly, please let me know. E-mail me the incorrect
(and corrected if possible) config.h file, and any other
information as appropriate.
CHANGES
4.18 [29 Nov 2009]
Code cleanup.
The default configuration method has been changed to
use a shell script. The perl configuration script is
still available (./Build -mkpl).
4.17 [22 Nov 2009]
Totals have been changed to add up whatever filesystems
are displayed. This is more intuitive for the user.
It is up to the user to exclude read-only filesystems
(cdfs, iso9660), memory-based filesystems (memfs, mfs, tmpfs)
and user filesystems (fuse*). Excluding the 'fuse' type will
exclude all fuse* filesystems.
As before, only the main pool of a pooled filesystem is totaled.
The build now works on unixware (getmntent is in libgen).
The build now works on syllable.
The default configuration method has been changed to
use the perl script. Removed iffe, as it doesn't support
class testing.
4.16 [20 Sep 2009]
Fixed a nested macro issue on Mac OS X 10.6.
Fixed bugs with filename arguments.
4.15 [17 Sep 2009]
Fixed filename argument w/non-printing filesystem.
Build now works on Haiku.
4.14 [10 Sep 2009]
Code cleanup.
Change size labels to match SI standards (1024 vs 1000).
Build now works on Debian GNU-kFreeBSD.
4.13 [25 May 2008]
Fixed totals to correctly account for pooled filesystems.
4.12 [19 Jan 2008]
Change of e-mail addresses.
4.11 [29 May 2007]
Fixed minor bug for 'di -sn -t' introduced in 4.10.
Code cleanup -- move global variables into local structures.
Recoded sorting, added sort by filesystem type.
4.10 [24 Feb 2007]
Handle pooled filesystems so that the total space
doesn't get added more than once.
Compaq Tru64 advfs is untested.
4.9 [2 Nov 2006]
Fixed an uninitialized variable used for Solaris zones.
Minor fixes to mkconfig.pl.
4.8 [5 Oct 2006]
Linux's statvfs() is not POSIX compliant and does not
use f_frsize. The correct value is returned in f_bsize.
Since there's no way to tell which type of statvfs() is
in use, we have to hard-code the logic for linux.
This sucks.
More minor improvements to mkconfig.pl.
Add logic to find the correct msgfmt program to use.
4.7 [23 Sep 2006]
Changed the operation of the -a, -x and -I flags
so that it is possible to specify -a and still exclude
filesystems from the list.
Added the -L flag to not check for duplicate filesystems.
4.6 [3 Sep 2006]
Improve mkconfig.pl configuration to be more robust,
find needed libraries. Improve mkconfig.pl portability.
4.5 [29 Mar 2006]
Fix uninitialized variable.
Fix manual page formatting.
4.4 [21 Nov 2005]
Add zone support for Solaris (-z).
Update mkconfig.pl for compatibility w/perl 5.005.
4.3 [29 Oct 2005]
Change -P option and POSIXLY_CORRECT environment
variable to display POSIX standard output.
Add 'a' and '3' format options to display %avail
and %free space (request by Bill Poser).
Add check and routine to use getvfsstat() for NetBSD 3.x.
Add processing of DI_ARGS environment variable.
4.2 [12 Oct 2005]
Added -nonls argument to 'Build' to turn off all NLS.
Add +DAportable for HP-UX 10.x.
Add -qmaxmem=-1 for AIX.
Fix compile warning in dilib.c for AIX.
Improve tests for libintl.sl for HP-UX.
Check /usr/local for libintl.sl also.
Version number was inadverdently left as 4.1.
4.1 [6 Aug 2005]
Created a perl script as an alternative to iffe
to create the config.h file.
Internationalization configuration now works for Cygwin,
FreeBSD, NetBSD and HP/UX.
4.0 [26 Jul 2005]
Metadist is no longer supported; Only the iffe configuration
method is now available.
Removed -h help flag, changed it to be scaled alternative 1
display to match other 'df' programs.
Alias -x to -i to match other 'df' programs. -x will be preferred.
Old -x (debug) changed to -X.
POSIX -dp flag was broken. Removed. Added -P option.
Alias -F to -I for compatibility.
Updates to manual page.
Internationalization files are now automatically installed if the
NLS routines are detected.
3.11 [11 mar 2004]
Fixed bug: checking mount options to see if partition
was read-only (bsd style get/set/endmntent).
3.10 [26 feb 2004]
Added German .po file (Many thanks to Hartmut Haase).
Added -64 to Build for 64 bit binaries.
Added missing internationalization calls in di.c.
3.9 [25 may 2003]
Fixed bug with uninitialized 'dbsstr' variable.
iffe: upgraded to 2002-03-06.
Don't need to include stdio.h in most di.iffe tests.
lib test fixed for cygwin.
3.8 [12 jan 2003]
Rewrote block size display processing. It did not match the
*BSD implementation of the BLOCKSIZE environment variable.
Latest metaconfig (Configure)
Add -k alias for -dk.
3.7 [4 sep 2002]
Check for initial '/' character in special device name
before doing stat(). Otherwise we pick up normal files.
Update iffe.
Add exa, zetta, yotta support (-de, -dz, -dy).
Add support for 1000 byte base block size (and others) (-b option).
Add alternative scaled format (-dH, -H).
3.6 [30 jul 2002]
Change to use mntctl() in preference to set/get/endmntent()
for AIX.
AIX: fix to display hostname in special device name for
remote mounts.
README updated for cygwin Configure/configure problem.
Workaround in di.h for cygwin/Configure getopt() problem.
Converted all strcpy() to strncpy().
3.5 [17 jul 2002]
Change 'memfs' to 'mfs' for memory file system (FreeBSD).
Not added to totals.
Added License.
Update to use snprintf if available.
Update 'Configure' to match 'iffe' build as closely as possible.
Fix C code to compile w/non-ansi compiler (HP-UX bundled).
Many configuration fixes (hp-ux, aix, et.al.).
3.4 [20 apr 2002]
Fix bugs in include/ignore list generation.
Rewrite ignore/include lists to allow multiple command line
specification of ignore/include lists.
Change so -f overrides DIFMT environment variable.
Fix bugs in -s command line option. Make more friendly.
Add -H (-dh) scaled display format.
nfs mounts are always remote.
3.3 [1 apr 2002]
Bug fixes for AIX, HP/UX installation.
3.2 [27 feb 2002]
Add internationalization code.
Update windows code.
cleanup.
3.1 [15 nov 2001]
Bug fixes for SunOS 4.
3.0 [7 aug 2001]
Added getfsstat() for Compaq Tru-64 (and FreeBSD, etc.) systems.
Compaq Tru-64 code cleaned up.
Thanks to Compaq for their test drive program!
More cleanup. Added iffe configuration.
2.4 [12 feb 2001]
Fixed so di doesn't statfs() the disks it doesn't need to.
Removed fs basetype stuff.
Split out disk routines into separate module. Lots of cleanup.
Totals: fix to take into account block size of partition.
Totals: ignore read-only, partitions not normally printed.
Totals: ignore memory filesystems (tmpfs, memfs).
2.3 [24 feb 2000]
Modified hints for solaris to do 64 bit compilation.
Removed extra libc setting for linux.
Added support for BeOS. This required ansi function headers.
2.2 [24 dec 1999]
Hints for dec_osf added.
Changed HAS_GETMNTINFOFSIZE to be preferred over
HAS_GETMNTINFOBSIZE; modified bsdos hints appropriately.
Look for <sys/fs_types.h> include file.
2.1 [24 dec 1999]
Added +DAportable for HP-UX.
Hints for openbsd added.
Made installperm as separate target in makefile.
Modified duplicate checking slightly.
Changed MNT_NOWAIT to MNT_WAIT. This will work better
on FreeBSD. Hopefully will work w/nfs mounts.
2.0 [15 apr 1999]
Now uses dist 3.0PL70 for configuration.
Duplicate filesystems (automounted) are not displayed.
This probably does not work for Digital's advfs.
1.24 [never released]
Added Windows w/gcc.
The Solaris 2.6 statvfs() bug has a patch out for it.
Patch #105572-05 (?).
1.23 [6 jul 1998]
Improved Windows.
1.22 [1 jul 1998]
Added Windows. Don't know the routines to get the number
of file slots or the file system type (FAT12/16/32).
Changed default to display megabytes.
1.21 [8 sep 1997]
Fixed AIX typo.
Linux 2.x
1.20
Added Solaris large file system support. Note that
ver 2.6 Beta_Update has a bug in the statvfs() routine,
and the non-root available disk space is improperly
reported.
1.19 [4 feb 1996]
Added mount time, mount options. Link di to the mi command.
1.18 [21 aug 1995]
Fixed some ignore/include list problems. Fixed local mount
flag for OSF/1.
1.17 [10 aug 1995]
Changed block values from unsigned long to doubles so that we
can display using different block sizes (-d flag).
Added -l flag for local filesystems only.
1.16 [8 aug 1995]
Added A/UX [ blemoine@-NOSPAM-atheist.tamu.edu (Brett G. Lemoine) ]
Added convex [ "Schilperoort J.W." <J.W.Schilperoort@-NOSPAM-research.ptt.nl> ]
1.15 [1 aug 1995]
Fixed bsdi 1.x and bsdi 2.x. Fragments weren't supported.
Fixed FreeBSD 1.x and 2.x; same problem.
Changed sco_sl makefile entry.
1.14 [22 jul 1995]
Fixed problem with display widths in conjunction with
ignore/include lists.
1.13 [17 mar 1995]
changed default length of filesystem type field to 7.
new debug 'all' format.
check for 0 fragment size; replace w/block size if we have it.
1.12 [28 jan 1995]
sco nfs 'nothing' fix.
freebsd 2.x; better freebsd filesystem types.
1.11 [3 dec 1994]
bsdi
1.10 [24 nov 1994]
added freebsd.
1.9 [30 aug 1994]
makefile fixes.
1.8 [28 may 1994]
removed mount option junk.
added AIX.
1.7 [2 may 1994]
cleaned up sgi in the makefile.
changed linux to be w/o need_statfs_defs.
solaris cdrom returning all sorts of negative values.
T format option.
mount options.
SunOs filesystem type info.
1.6 [never released]
ultrix bug fixes.
add dynix to makefile.
1.5 [26 mar 1994]
sun had f_bfree instead of f_bavail!
xenix, linux, sco
-w, -W, -B.
fixed width for -f M, -f S.
usage.
Allow other characters in format string.
1.51 (local, pat@rwing)
SunOS *does* support filesystem type info. Its all in the
mntent structure, but requires a small bit of work (see source).
1.4 [4 mar 1994]
-f B
bcopy.
solaris cdrom reports -2 for free blocks.
1.3 [3 mar 1994]
Command line specification of filenames.
sort output.
osf/1, ultrix.
-F, -f M, -F S.
1.2 [2 mar 1994]
# of inodes can be -1L
return code for getDiskInfo shouldn't be checked.
name of mount point must be maxpathlen.
error conditions.
pyramid.
1.1 [27 feb 1994]
initial release
ACKNOWLEDGEMENTS
And for their comments/source/manual pages and/or bug fixes, thanks!
jjb@NOSPAM-jagware.bcc.com (J.J.Bailey)
vogelke@NOSPAM-c-17igp.wpafb.af.mil (Contr Karl Vogel) [pyramid]
costales@NOSPAM-ICSI.Berkeley.EDU (Bryan Costales)
Mark Neale <mark@NOSPAM-edscom.demon.co.uk>
Pat Myrto <pat@NOSPAM-rwing.uucp> [sunOS filesystem type stuff]
henrikar@NOSPAM-utctu1.ct.utwente.nl (Henri Karrenbeld) [sgi]
Peter Bray <Peter.Bray@NOSPAM-serg.cse.unsw.edu.au>
gsipe@NOSPAM-pyramid.com (George M. Sipe) [manual page]
Jeffrey Mogul <mogul@NOSPAM-pa.dec.com>
[ultrix, osf/1, manual page, new format options]
thomas@NOSPAM-idx.kodak.com (Th. Bullinger) [help usage]
Seth Theriault <seth@NOSPAM-connact.com> [next, tru64]
steve@NOSPAM-nshore.org (Stephen J. Walick) [SCO]
Gerald Rinske <gerald@NOSPAM-D012F291.mch.sni.de> [sgi]
Mike Grupenhoff <kashmir@NOSPAM-snare.dorm.umd.edu> [linux]
R.K.Lloyd@NOSPAM-csc.liv.ac.uk [hpux]
"William Gibbs" <bill@NOSPAM-wgc386.MV.COM> [xenix]
Randy Thompson <randyt@NOSPAM-sequent.com> [sequent]
eriko@NOSPAM-risc.austin.ibm.com (O'Shaughnessy Erik) [aix]
Bill Davidsen <davidsen@NOSPAM-tmr.com>
[linux, SCO, etc., new format options]
fredex@NOSPAM-fcshome.stoneham.ma.us (fred smith) [coherent 4.2.05]
bag@NOSPAM-clipper.cs.kiev.ua (Andrey Blochintsev) [bsdi]
ginsbach@NOSPAM-spacestar.net (Brian Ginsbach) [netbsd, irix, unicos]
et. al.
COPYRIGHT
Copyright 1994-2009 Brad Lanam, Walnut Creek, CA, USA
bll6969di_at_gmail.com
http://www.gentoo.com/di/
|