Created
June 26, 2014 06:32
-
-
Save fourdollars/c429ea26ead2d38aeeb1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* gcc gio_mount_disk.c `pkg-config --cflags glib-2.0 gio-unix-2.0 --libs` -o gio_mount_disk */ | |
#include <stdio.h> | |
#include <glib.h> | |
#include <gio/gunixmounts.h> | |
int main(int argc, char* argv[]) | |
{ | |
GList *p, *points = g_unix_mount_points_get (NULL); | |
for (p = points; p != NULL; p = p->next) { | |
GUnixMountEntry *mount = p->data; | |
const char *mount_path = g_unix_mount_get_mount_path (mount); | |
const char *fs = g_unix_mount_get_fs_type (mount); | |
const char *device = g_unix_mount_get_device_path (mount); | |
printf("mount: %s, fs: %s, device: %s\n", mount_path, fs, device); | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment