delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2011/03/14/12:11:55

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-4.5 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,T_RP_MATCHES_RCVD
X-Spam-Check-By: sourceware.org
X-IronPortListener: Outbound_SMTP
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: AvEAAC/bfU2cKEcV/2dsb2JhbACYRI1Fd6ZrmTyFYgSQOg
From: "Buchbinder, Barry (NIH/NIAID) [E]" <BBuchbinder AT niaid DOT nih DOT gov>
To: cygwin cygwin <cygwin AT cygwin DOT com>
CC: "'Charles Russell'" <worwor AT bellsouth DOT net>
Date: Mon, 14 Mar 2011 12:11:33 -0400
Subject: RE: How to read thumb drive volume label
Message-ID: <0105D5C1E0353146B1B222348B0411A209DAA1008C@NIHMLBX02.nih.gov>
References: <4D7E200C DOT 40707 AT bellsouth DOT net>
In-Reply-To: <4D7E200C.40707@bellsouth.net>
MIME-Version: 1.0
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

Charles Russell sent the following at Monday, March 14, 2011 10:03 AM
>Is there some way to read the volume label on a USB flash drive?
>Something like blkid in linux?

Something like this?

function label() {
    $(cygpath --sysdir)/cmd /c dir ${1}:\\ | \
        tr \\r \\n | \
        sed -n -e '1s/^ Volume in drive . is //p'
    }

Or you could play with

$(cygpath --sysdir)/label.exe

Note that both require that one provides the drive letter.

I hope this was not OT.  I apologize for use of tools that come
with Windows, but sometimes I find native tools to be easiest.

- Barry
  Disclaimer: Statements made herein are not made on behalf of NIAID.

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019