summaryrefslogtreecommitdiff
path: root/examples/df.c
diff options
context:
space:
mode:
authorBenoît Dejean <bdejean@src.gnome.org>2007-09-21 22:26:18 +0000
committerBenoît Dejean <bdejean@src.gnome.org>2007-09-21 22:26:18 +0000
commit771f0848b352f0586ee687077f2548e379745b02 (patch)
tree4b825dc642cb6eb9a060e54bf8d69288fbee4904 /examples/df.c
parentfcee021a2d23a8c1d84e1c6411f2d2561514a5aa (diff)
downloadlibgtop-affinity.tar.gz
Killed branch. SVN SUCKS.affinity
Killed branch. SVN SUCKS. svn path=/branches/affinity; revision=2662
Diffstat (limited to 'examples/df.c')
-rw-r--r--examples/df.c51
1 files changed, 0 insertions, 51 deletions
diff --git a/examples/df.c b/examples/df.c
deleted file mode 100644
index 6537ce44..00000000
--- a/examples/df.c
+++ /dev/null
@@ -1,51 +0,0 @@
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-#include <glibtop.h>
-
-#include <glibtop/fsusage.h>
-#include <glibtop/mountlist.h>
-
-#include <stdio.h>
-
-
-static void print_fsusage(const char *mountpoint)
-{
- glibtop_fsusage buf;
-
- glibtop_get_fsusage(&buf, mountpoint);
-
- printf("%-20s %-10llu %-10llu %-10llu %.1f\n",
- mountpoint,
- buf.blocks * buf.block_size >> 20,
- (buf.blocks - buf.bavail) * buf.block_size >> 20,
- buf.bavail * buf.block_size >> 20,
- (buf.blocks - buf.bavail) * 100.0 / buf.blocks
- );
-}
-
-
-int main()
-{
- glibtop_mountlist buf;
- glibtop_mountentry *entries;
- size_t i;
-
- glibtop_init();
-
- printf("%-20s %-10s %-10s %-10s %-10s\n",
- "Filesystem", "Size", "Used", "Avail", "Use%");
-
- entries = glibtop_get_mountlist(&buf, FALSE);
-
- for(i = 0; i < buf.number; ++i)
- {
- print_fsusage(entries[i].mountdir);
- }
-
- g_free(entries);
-
- glibtop_close();
-
- return 0;
-}