[Gambas-user] Usb
Kende Krisztián
nemh at ...2007...
Tue Jul 30 11:52:40 CEST 2013
> >> is it possible to list all the usb devices on a system?
> >>
> > Yeah, the lsusb command is your friend.
> >
>
> I should have said usb drive I was thinking using dev some how
>
No problem, I use this:
Dim item, dev, name As String
For Each item In Dir("/dev/disk/by-id", "usb-*", gb.Link)
dev = Stat("/dev/disk/by-id/" & item).Link
dev = "/dev/" & Right(dev, - RInStr(dev, "/"))
If Len(dev) = 8
name = Right(item, -4)
name = Left(name, RInStr(name, "_"))
Print dev & " " & Replace(name, "_", " ")
Endif
Next
More information about the User
mailing list