我怎样才能知道USB存储设备安装? [英] How can I know where USB Storage Device is mounted?

查看:207
本文介绍了我怎样才能知道USB存储设备安装?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要知道该设备是安装(路径)。我使用产品中的libusb当设备插入知道。
我需要知道如何卸除设备℃。

I need to know where the device was mounted(path). I'm using the libusb to know when the device is plugged. And I need to know how to umount the device in C.

推荐答案

您可以运行系统命令是这样的:

You can run system commands like this :

#include <iostream>
#include <stdio.h>/*optional*/
#include <stdlib.h>

void main() {
    system("cat /proc/mounts");
    system("cat /etc/mtab");
    system("umount /dev/sda1");
}

请参阅 http://pubs.opengroup.org/onlinepubs/009604499/functions /system.html

这篇关于我怎样才能知道USB存储设备安装?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆