Recognise a USB stick

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Howlernator
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 18
Joined: Wed Oct 13, 2010 4:44 am

Recognise a USB stick

Post by Howlernator » Tue Feb 21, 2012 5:09 am

Heya Folks,

Anyone got a command / function lying around that will find a USB stick on Mac/Win and return a path to it?

Warm regards,

A.

hliljegren
Posts: 111
Joined: Sun Aug 23, 2009 7:48 am
Contact:

Re: Recognise a USB stick

Post by hliljegren » Mon Mar 26, 2012 1:05 pm

I guess that really depends on what kind of "USB-stick" you imply, and what "find" means. On the Mac you can use the system_profiler command via the shell to probe the USB-chain:

Code: Select all

put shell("system_profiler SPUSBDataType")
:-Håkan
___________________________________
MacBook Pro M1 MAX 64 Gb,
LiveCode 10.0.1rc3

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7389
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: Recognise a USB stick

Post by jacque » Mon Mar 26, 2012 5:26 pm

You could try "the volumes". It won't give you info about the type of device but it should list the name of the USB drive.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Post Reply