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: 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; '>': 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: <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 To: Tim Roberts Content-Type: multipart/alternative; boundary=001a11c26722bb31a504d99cfda2 Cc: python-list X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: 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 --001a11c26722bb31a504d99cfda2 Content-Type: text/plain; charset=ISO-8859-1 On 5 April 2013 06:20, Tim Roberts wrote: > John Nagle 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 --001a11c26722bb31a504d99cfda2 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
On 5 April 2013 06:20, Tim Roberts <<= a href=3D"mailto:timr@probo.com" target=3D"_blank">timr@probo.com> wrote:
John Nagle <nagle= @animats.com> wrote:
>
> =A0 That would be useful to have as a portable function for all USB >devices. =A0Serial port devices are particularly annoying, because thei= r
>port number is somewhat random when there's more than one, and chan= ges
>on hot-plugging.

There is no portable solution. =A0Every operating system handles this= kind of
this very differently. =A0Remember, the operating system abstractions are a= ll
designed to hide this from you. =A0When you open a serial port or an audio<= br> device or use a file system, you aren't supposed to KNOW that there is = a
USB device behind it

Indeed. Whic= h means I have a working solution under Linux, but I am struggling to find = one under OS =A0X.

Looks like I might = have to resort to just parsing the USB tree until I find the device that wa= s inserted.=A0

--
./Sven
--001a11c26722bb31a504d99cfda2--