Problem closing non-responsive USB-serial ports
sarah.reichelt at gmail.com
Mon Mar 10 22:19:35 EDT 2008
> Is it OK in your case to ask the OS to intervene?
Yes, I'd have no problem with that.
> If so, would something
> like this work?
> on mouseUp
> unmountVolume (the selectedText of fld 1)
> put the result
> end mouseUp
> on unmountVolume pVolumeName
> put shell("diskutil list") into tList
> filter tList with ("* " & pVolumeName & " *")
> put last word of tList into tDisk
> put shell("diskutil unmount" && tDisk) into tResult
> return tResult
> end unmountVolume
The USB device is not a volume, so does not appear in the diskutil's listing.
At the moment I have installed a workaround where it just reboots the
computer if the USB-serial commas stop. Trying to reset the link hangs
my app, so hopefully rebooting immediately will work, although it is
not a great system. Now of course, the problem hasn't happened for a
few hours, so I'm still waiting to see of it will succeed.
More information about the Use-livecode