[27596] in Perl-Users-Digest
Perl-Users Digest, Issue: 9111 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Mar 31 21:05:34 2006
Date: Fri, 31 Mar 2006 18:05:03 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Fri, 31 Mar 2006 Volume: 10 Number: 9111
Today's topics:
How to reuse the FS_ wordlist from Win32API::File? <rvtol+news@isolution.nl>
Re: How to reuse the FS_ wordlist from Win32API::File? <rvtol+news@isolution.nl>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sat, 1 Apr 2006 01:15:03 +0200
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: How to reuse the FS_ wordlist from Win32API::File?
Message-Id: <e0kkmf.210.1@news.isolution.nl>
#!/usr/bin/perl
# demo GetVolumeInformation() (hi Tad)
use strict;
use warnings;
use Win32API::File qw ( GetVolumeInformation :FS_ );
### Is there a nicer/shorter way to express
## @{$Win32API::File::EXPORT_TAGS{FS_}} ?
#
my $FS_ref = $Win32API::File::EXPORT_TAGS{FS_};
my @GetVolumeInformation_P = qw( sRootPath osVolName lVolName
ouSerialNum
ouMaxNameLen ouFsFlags osFsType
lFsType );
my @GetVolumeInformation = ( 'C:/', undef, undef, undef,
undef, undef, undef,
undef );
GetVolumeInformation( @GetVolumeInformation )
or die "GetVolumeInformation:\t"
. $GetVolumeInformation[0]
. "\n\t $^E\n\t$!";
for my $i ( 0 .. $#GetVolumeInformation )
{
### The next line starts strange; how to do it nicer?
##
#
my $v; $v = defined() ? $_ : '' for $GetVolumeInformation[$i];
# If numeric, then show the hexadecimal representation as well.
printf "%d\t[%s]\t%s%s\n"
, $i
, $GetVolumeInformation_P[$i]
, $v
, ($v =~ /\A[0-9]+\z/) ? sprintf("\t[hex %x]", $v) : '';
# Intermezzo: show the FS_ Flags.
if (5 == $i)
{
local @_;
eval "push \@_, '$_' if $_ & \$v" for @$FS_ref;
print "\t@_\n";
}
}
__END__
See the two questions marked with ###.
Any comments welcome too.
(For info about "BUFFER SIZES", see Win32API::Registry.)
--
Affijn, Ruud
"Gewoon is een tijger."
------------------------------
Date: Sat, 1 Apr 2006 01:38:52 +0200
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: How to reuse the FS_ wordlist from Win32API::File?
Message-Id: <e0kltn.1vs.1@news.isolution.nl>
Dr.Ruud schreef:
> my @GetVolumeInformation_P = qw( sRootPath osVolName lVolName
> ouSerialNum
> ouMaxNameLen ouFsFlags osFsType
> lFsType );
> my @GetVolumeInformation = ( 'C:/', undef, undef,
> undef, undef, undef, undef,
> undef );
Blegh, make that:
my @GetVolumeInformation_P =
qw( sRootPath osVolName lVolName ouSerialNum
ouMaxNameLen ouFsFlags osFsType lFsType );
my @GetVolumeInformation =
( 'C:/', undef, undef, undef,
undef, undef, undef, undef );
(just reformatted)
--
Affijn, Ruud
"Gewoon is een tijger."
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>
Administrivia:
#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc. For subscription or unsubscription requests, send
#the single line:
#
# subscribe perl-users
#or:
# unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.
NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.
#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V10 Issue 9111
***************************************