Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #42816

Re: Getting USB volume serial number from inserted device on OSX

Path csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <svenito@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.010
X-Spam-Evidence '*H*': 0.98; '*S*': 0.00; 'tree': 0.05; 'linux,': 0.07; 'subject:Getting': 0.07; 'differently.': 0.09; 'parsing': 0.09; 'subject:number': 0.09; 'cc:addr:python-list': 0.11; 'random': 0.14; 'changes': 0.15; '>on': 0.16; 'portable': 0.16; 'wrote:': 0.18; 'solution.': 0.20; 'handles': 0.22; 'cc:addr:python.org': 0.22; "aren't": 0.24; 'looks': 0.24; 'cc:2**0': 0.24; '&gt;': 0.26; 'header:In-Reply-To:1': 0.27; 'function': 0.29; 'tim': 0.29; 'message-id:@mail.gmail.com': 0.30; 'file': 0.32; 'supposed': 0.32; 'open': 0.33; 'device': 0.34; 'received:74.125.82': 0.34; 'subject:from': 0.34; 'one,': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'useful': 0.36; 'behind': 0.37; 'operating': 0.37; 'system,': 0.38; 'audio': 0.38; 'received:74.125': 0.39; 'devices': 0.61; 'john': 0.61; 'you.': 0.62; 'kind': 0.63; 'more': 0.64; 'serial': 0.72; 'remember,': 0.93; '2013': 0.98
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=53/VeQlfouMX8JhxtnHHXho2P+AwlyWY+RHct9EzAno=; b=05ym645rodGH9QKdBfEiQ+vC+QN2JE2brHpR45YaZXugJNiH1ij/a0r+K+EO2Fc/Tu hBFPvG4wtCxrnNxqYWFf80BajRrQhSO8wl5bGyBTejH1b66jhz1Whpjq7lfuJtLgBx9G TfRXsjIH02WYvgvqChOcJlAFrQGpGK7YeQAz01nJQHC4JmaPMntZyPHfaxpqNAXEA6t3 uxXf2BVWqG2dR4t/5Eo8La6VN+f7JTal7FbsDKLU5khAlfLcz7orMotqo+RnEtueTRcq dlpRzFGrRhL39DpHNlMUkhNiiIW6CPBn9iP8k/nRA6m7ltRLuFMHhVH0OP4IUbYLS0L1 kdlA==
MIME-Version 1.0
X-Received by 10.180.187.129 with SMTP id fs1mr4292188wic.5.1365168201870; Fri, 05 Apr 2013 06:23:21 -0700 (PDT)
In-Reply-To <2knsl8t9uacsb612cd2kuv43ipr7djrcmg@4ax.com>
References <mailman.25.1364941140.3114.python-list@python.org> <kjlavt$v8j$1@dont-email.me> <2knsl8t9uacsb612cd2kuv43ipr7djrcmg@4ax.com>
Date Fri, 5 Apr 2013 14:23:21 +0100
Subject Re: Getting USB volume serial number from inserted device on OSX
From Sven <svenito@gmail.com>
To Tim Roberts <timr@probo.com>
Content-Type multipart/alternative; boundary=001a11c26722bb31a504d99cfda2
Cc python-list <python-list@python.org>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.139.1365168203.3114.python-list@python.org> (permalink)
Lines 65
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1365168203 news.xs4all.nl 6863 [2001:888:2000:d::a6]:54733
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:42816

Show key headers only | View raw


[Multipart message — attachments visible in raw view] - view raw

On 5 April 2013 06:20, Tim Roberts <timr@probo.com> wrote:

> John Nagle <nagle@animats.com> wrote:
> >
> >   That would be useful to have as a portable function for all USB
> >devices.  Serial port devices are particularly annoying, because their
> >port number is somewhat random when there's more than one, and changes
> >on hot-plugging.
>
> There is no portable solution.  Every operating system handles this kind of
> this very differently.  Remember, the operating system abstractions are all
> designed to hide this from you.  When you open a serial port or an audio
> device or use a file system, you aren't supposed to KNOW that there is a
> USB device behind it
>

Indeed. Which means I have a working solution under Linux, but I am
struggling to find one under OS  X.

Looks like I might have to resort to just parsing the USB tree until I find
the device that was inserted.

-- 
./Sven

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Getting USB volume serial number from inserted device on OSX Sven <svenito@gmail.com> - 2013-04-02 23:18 +0100
  Re: Getting USB volume serial number from inserted device on OSX John Nagle <nagle@animats.com> - 2013-04-04 18:58 -0700
    Re: Getting USB volume serial number from inserted device on OSX Tim Roberts <timr@probo.com> - 2013-04-04 22:20 -0700
      Re: Getting USB volume serial number from inserted device on OSX Sven <svenito@gmail.com> - 2013-04-05 14:23 +0100

csiph-web