www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/02/26/17:43:13

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/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
Message-ID: <01d901c2dde8$38b6a400$4d1f1cac@THEODOLITE>
From: "Bruce Dobrin" <dobrin AT imageworks DOT com>
To: "Robert Citek" <rwcitek AT alum DOT calberkeley DOT org>
Cc: <cygwin AT cygwin DOT com>
References: <3 DOT 0 DOT 5 DOT 32 DOT 20030224173519 DOT 00f8fbc0 AT mail DOT earthlink DOT net> <3 DOT 0 DOT 5 DOT 32 DOT 20030226160301 DOT 01fe7428 AT mail DOT earthlink DOT net>
Subject: Re: cpu and partition info
Date: Wed, 26 Feb 2003 14:41:37 -0800
MIME-Version: 1.0
X-Priority: 3
X-MSMail-Priority: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106

on older (NT?) os's,  there are 2 places which each have 1/2 of the info
needed to emulate the standard "hinv" format.  I don't remember when or
where the cutoff is,  it is so that all works the same on XP , 2k and NT and
with the rest of the "hinv" code ( I only sent a little as an example...)
----- Original Message -----
From: "Robert Citek" <rwcitek AT alum DOT calberkeley DOT org>
To: "Bruce Dobrin" <dobrin AT imageworks DOT com>
Cc: <cygwin AT cygwin DOT com>
Sent: Wednesday, February 26, 2003 2:03 PM
Subject: Re: cpu and partition info


>
> Thanks, Bruce,
>
> At 12:02 PM 2/26/2003 -0800, Bruce Dobrin wrote:
> >It took me about an hour to change/add enough to the perl GPL "hinv" port
to
> >get it to work with cygwin ( hinv v 1.4pre2).
>
> I took your code and modified it.  Works great under Cygwin.  See below.
>
> I'm not quite sure what this code does:
>   $name=`cat "$cpu/VendorIdentifier" << cat "$cpu/Identifier"` ;
>
> Regards,
> - Robert
>
> -----
>
> #!/usr/bin/perl -w
>
> use strict;
>
> my ($info, $cpu, $speed, $name);
>
> $info="/proc/registry/HKEY_LOCAL_MACHINE/HARDWARE" .
>       "/DESCRIPTION/System/CentralProcessor";
>
> for $cpu (<$info/*>) {
>   $speed=unpack ("l", `cat $cpu/~MHz`) if -e "$cpu/~Mhz" ;
>   if (-e "$cpu/ProcessorNameString") {
>     $name=`cat $cpu/ProcessorNameString`;
>   } else {
>     $name=`cat "$cpu/VendorIdentifier" << cat "$cpu/Identifier"` ;
>   }
>   $cpu =~ s#^.*/## ;
>   print "$cpu: $speed MHz : $name\n";
> }
>
>
> --
> Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
> Bug reporting:         http://cygwin.com/bugs.html
> Documentation:         http://cygwin.com/docs.html
> FAQ:                   http://cygwin.com/faq/
>


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


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