Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Message-Id: <3.0.5.32.20030226160301.01fe7428@mail.earthlink.net>
X-Sender: rwcitek@mail.earthlink.net
Date: Wed, 26 Feb 2003 16:03:01 -0600
To: "Bruce Dobrin" <dobrin@imageworks.com>
From: Robert Citek <rwcitek@alum.calberkeley.org>
Subject: Re: cpu and partition info
Cc: <cygwin@cygwin.com>
In-Reply-To: <00aa01c2ddd1$f033dfb0$4d1f1cac@THEODOLITE>
References: <3.0.5.32.20030224173519.00f8fbc0@mail.earthlink.net>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"


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/

