安装 iPod 时显示奇怪的 URI 字符串

发布于 2024-10-10 07:48:43 字数 357 浏览 0 评论 0原文

我编写了一个小程序来检测设备何时安装在运行 Linux 的桌面上。我为此使用了 GIO。我正在提取已安装资源的 URI 并将其显示给用户。当我放入 CD 时,我得到一个 URI 字符串,看起来像 file:///media/cdrom0/ ,我可以理解。但是当我安装 iPod 时,我看到的 URI 类似于 gphoto2://[usb:002,028]。这意味着什么?我观察到,每次我取出设备并重新插入时,第二个数字 (028) 都会不断增加。有人可以帮我解释一下这个 URI 吗?

更新:正如shodanex所回答的,这两个数字分别是总线号和设备号。 gphoto2:// 表示协议(PTP/MTP)。

I have written a small program to detect whenever a device is mounted on a desktop running Linux. I have used GIO for this. I am extracting the URI of the mounted resource and displaying it to the user. When I put in a CD I get a URI string which looks like file:///media/cdrom0/ which I can understand. But when I mount an iPod the URI I see is something like gphoto2://[usb:002,028]. What does this mean? I have observed that the second number (028) keeps increasing every time I take the device out and plug it back in. Can some one interpret this URI for me?

Update: As shodanex answered, the two numbers are the bus number and device number respectively. gphoto2:// indicates the protocol (PTP/MTP).

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

茶底世界 2024-10-17 07:48:43

gphoto2://[usb:002,028]

我猜002是总线号,28是该总线上设备的地址。
它映射到 lsusb util 输出的第二个和第四个字段。这是一个例子
在我的系统上:

Bus 001 Device 015: ID 05e3:0715 Genesys Logic, Inc. USB 2.0 microSD Reader

我想它会翻译成:

usb:001,015

gphoto2://[usb:002,028]

I guess 002 is the bus number, and 28 is the adress of the device on that bus.
It maps to the second and fourth field of the lsusb util output. Here is an example
on my system :

Bus 001 Device 015: ID 05e3:0715 Genesys Logic, Inc. USB 2.0 microSD Reader

I guess it would translate to :

usb:001,015
千年*琉璃梦 2024-10-17 07:48:43

我在 Nautilus 中也有此类 URL,但其他响应没有解释它与磁盘上的安装位置有何关系。我可以通过 Nautilus 文件浏览器浏览 SD 卡上的文件,但我在 /mnt/ 或 /media/ 或我通常寻找自动安装的文件系统的其他任何地方都看不到任何这些文件。

最终我尝试右键单击该文件夹,选择“用其他应用程序打开”,选择文本编辑器,然后我可以看到该文件夹​​实际上安装在:
'~/.gvfs/gphoto2 mount on usb%3A001,010'

我希望 ubuntu 中的 Nautilus 和其他工具能够提供一些更明显的方式来查找这些文件...这看起来相当不直观。

I have these kinds of URL's in Nautilus too, but the other response doesn't explain how that relates to a mount location on disk. I can navigate through the files on an SD card via the Nautilus file browser, but I don't see any of these files in /mnt/ or /media/ or anywhere else I would typically look for automatically mounted file systems.

Eventually I tried right-clicking the folder, selecting "Open with other application," choosing a text editor, and then I could see that the folder was actually mounted at:
'~/.gvfs/gphoto2 mount on usb%3A001,010'

I wish Nautilus and other tools in ubuntu would provide some more obvious way to find these files... this seems pretty un-intuitive.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文