
Update 2018-4-11: The memory bug has been fixed in the Tcl interface, and various exit conditions (malloc failures, invalid options, --help, --version) are now handled properly.Update 2017-5-23: Updated to di version 4.44 (Exabyte overflow bug).Update 2016-8-26: The pre-built libraries now include .dll for windows with statically linked libgcc.Update 2016-8-9: I now have pre-built shared libraries available for the Tcl extension.
The pre-built packages below include the shared libraries for Linux, Mac Os X, Windows 32-bit and Windows 64-bit. If you need a shared library for some other system, let me know.Website: https://gentoo.com/di/


# assuming the diskspace extension is in the same directory as your script... set ext [info sharedlibextension] set lfn [file normalize [file join [file dirname [info script]] diskspace$ext]] load $lfn set di [diskspace -f {} /] ; # get only the basic information for root filesystem / {device /dev/sda1 fstype ext4 total 485893496832 free 269818650624 available 245113102336 totalinodes 30138368 freeinodes 29762805 availableinodes 29762805 mountoptions rw,errors=remount-ro} set di [diskspace -f {up} /] ; # also get the used space and percentage used. / {display {201.2G 50%} device /dev/sda1 fstype ext4 total 485893496832 free 269818736640 available 245113188352 totalinodes 30138368 freeinodes 29762805 availableinodes 29762805 mountoptions rw,errors=remount-ro} lassign [dict get $di / display] useddisplay percused set di [diskspace -d 1 -f up /] ; # instead, get the used value in bytes. / {display {216074854400 50%} device /dev/sda1 fstype ext4 total 485893496832 free 269818642432 available 245113094144 totalinodes 30138368 freeinodes 29762805 availableinodes 29762805 mountoptions rw,errors=remount-ro} lassign [dict get $di / display] usedbytes percused set di [diskspace -f {}] ; # get information on the usual list of filesystems.To build the Tcl extension:Most systems:
cd C; make -e tcl-shWindows Cygwin:
cd C; make -e CC=gcc NO_PIE=yes tcl-shWindows Msys:
cd C; make -e WINAPI=T NO_PIE=yes LDFLAGS_SHARED="-static-libgcc" tcl-sh