RE: [nbux-users] bpmedialist problem
Status: Beta
Brought to you by:
pbuschman
|
From: Kirk, T. <Ter...@ke...> - 2003-01-16 15:00:01
|
Hi Scott;
I must be missing something. I've just downloaded the latest version, 0.52=
, from SourceForge, and I see where the stringified value is calculated, bu=
t it never seems to be set in the record.
Here's the portion of the code, cut out of the 0.52 version of nbux.pm:
$status =3D hex($status);
my(@status_flags);
=20
my %statusCodes =3D (
0x200 =3D> 'MULTIPLEXED',
0x080 =3D> 'IMPORTED',
0x040 =3D> 'MULTIRETENTION',
0x008 =3D> 'FULL',
#0x004 =3D> 'UNREPORTED',
0x002 =3D> 'SUSPENDED',
0x001 =3D> 'FROZEN',
);
=20
my($key, $value);
while (($key, $value) =3D each %statusCodes) {
push @status_flags, $value if $status & $key;
}
=20
# Active is special as it's a 0 if it's active, so we check differently
# Basically as long as the first bit is off it's active.
#
#push @status_flags, 'ACTIVE' if (($status & 0x1) =3D=3D 0);
# Correction from Scott Grosch 11/12/2002 --PLB
#
push @status_flags, 'ACTIVE' if ($status & 0x3) =3D=3D 0;
=20
# Keep the real status around so people can do their own checks
# Binary checks are faster than string checks...
my $real_status =3D $status;
=20
##
##=20
##
my($record) =3D {
media_id=3D> "$media_id",
partner_id=3D> "$partner_id",
version=3D> "$version",
density=3D> "$density",
allocated=3D> "$allocated",
last_written=3D> "$last_written",
expiration=3D> "$expiration",
last_read=3D> "$last_read",
kbytes=3D> "$kbytes",
nimages=3D> "$nimages",
vimages=3D> "$vimages",
retention_level=3D> "$retention_level",
num_restores=3D> "$num_restores",
status=3D> "$status",
l_offset=3D> "$l_offset",
psize=3D> "$psize",
hsize=3D> "$hsize",
ssize=3D> "$ssize",
vmpool=3D> "$vmpool",
res1=3D> "$res1",
res2=3D> "$res2",
res3=3D> "$res3",
res4=3D> "$res4",
};
I printed the value in the status field and it is a numeric. Also, I don't =
see a field real_status in the hash.
Terry
-----Original Message-----
From: Grosch, Scott [mailto:sco...@in...]
Sent: Wednesday, January 15, 2003 5:15 PM
To: nbu...@li...
Subject: RE: [nbux-users] bpmedialist problem
Sure it does. $record->{'status'} is the stringified
status. $record->{'real_status'} is the hex status code
returned so you can parse yourself.
Then again, you might have an older version. I'm not sure
if the new one was released yet. I made the changes 9/10/02
to the code.
> -----Original Message-----
> From: Kirk, Terry [mailto:Ter...@ke...]=20
> Sent: Wednesday, January 15, 2003 1:12 PM
> To: nbu...@li...
> Subject: [nbux-users] bpmedialist problem
>=20
>=20
> Hi;
>=20
> It seems that bpmedialist decodes the status, but does not=20
> return it in the hash. It does return the numeric status.
>=20
> Terry
-------------------------------------------------------
This SF.NET email is sponsored by: A Thawte Code Signing Certificate=20
is essential in establishing user confidence by providing assurance of=20
authenticity and code integrity. Download our Free Code Signing guide:
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0028en
_______________________________________________
nbux-users mailing list
nbu...@li...
https://lists.sourceforge.net/lists/listinfo/nbux-users
|