Subject: | Bug in memory classification for Mac::SysProfile for OS X 10.6 |
Date: | Tue, 22 Dec 2009 18:05:44 -0500 |
To: | bug-Mac-SysProfile [...] rt.cpan.org |
From: | Scott Hannahs <sth [...] magnet.fsu.edu> |
Daniel,
I believe I have found a problem with Mac:SysProfile version 0.03. I
have been messing around with the OCSNG inventory system which calls
this module. When using
Mac OS X 10.6.2
Perl 5.10.0
The system profiler command returns:
% system_profiler SPMemoryDataType
Memory:
Memory Slots:
ECC: Enabled
DIMM Riser A/DIMM 1:
Size: 1 GB
Type: DDR2 FB-DIMM
Speed: 667 MHz
Status: OK
Manufacturer: 0x802C
Part Number: 0x3138484631323837324A4436363744364434
Serial Number: 0xE7095361
DIMM Riser A/DIMM 2:
Size: 1 GB
Type: DDR2 FB-DIMM
Speed: 667 MHz
Status: OK
Manufacturer: 0x802C
Part Number: 0x3138484631323837324A4436363744364434
Serial Number: 0xE7095367
<etc... for all the memory modules>
But the hash table for this has a table for "memory slots" that only
contains the entry for ECC. There is no entry for all the memory
modules. There should be a table for each Memory slot.
To get the memory slots the following code is used:
# create the profile object and return undef unless we get
something back
my $pro = Mac::SysProfile->new();
my $h = $pro->gettype('SPMemoryDataType');
return(undef) unless(ref($h) eq 'HASH');
# Workaround for MacOSX 10.5.7
if ($h->{'Memory Slots'}) {
$h = $h->{'Memory Slots'};
}
Any help or insight you can give on this would be appreciated.
-Scott
Dr. Scott Hannahs, Director of DC Field Instrumentation and Facilities
National High Magnetic Field Laboratory, Florida State University
http://sthmac.magnet.fsu.edu
1800 E. Paul Dirac Dr., Tallahassee FL 32310, (850)644-0216/FAX 644-0534