[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gambas-user
Subject:    Re: [Gambas-user] Usb
From:       Kende =?UTF-8?B?S3Jpc3p0acOhbg==?= <nemh () freemail ! hu>
Date:       2013-07-30 9:54:36
Message-ID: 20130730115436.1eb38add () Aspire5110
[Download RAW message or body]

> >> 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 for pendrives:

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

This not work with HDDs.

------------------------------------------------------------------------------
Get your SQL database under version control now!
Version control is standard for application code, but databases havent 
caught up. So what steps can you take to put your SQL databases under 
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic