Thanks, that helps a lot.akash_rawal wrote:The correct code is:jemimah wrote: Here's the code for mounting.Code: Select all
gchar *mntpnt = g_build_filename(PUP_EVENT_MNTPNT, (gchar *) input, NULL); gchar *cmd = g_strdup_printf("tmount '%s'", vol->unix_dev); g_mkdir_with_parents(mntpnt, S_IRWXU | S_IRWXG | S_IRWXO); g_spawn_command_line_sync(cmd, NULL, &stderr_data, &exitcode, &error); //g_chmod(mntpnt, S_IRWXU | S_IRWXG | S_IRWXO); g_free(cmd);
Rest of the code remains as original. This will also save you from extra hassle of finding labels.Code: Select all
gchar *mntpnt; if (vol->label && (g_strcmp0(vol->label, "") != 0)) mntpnt = g_build_filename(PUP_EVENT_MNTPNT, vol->label, NULL); else mntpnt = g_build_filename(PUP_EVENT_MNTPNT, (gchar *) input, NULL);
I do like to use tmount (which is adapted from drive_all) because it does things like offer to fuser the drive when it can't be unmounted.