Accessing Extended File Attributes - Word Document

Accessing Extended File Attributes - Word Document

am 31.10.2009 00:23:38 von tim moor

--===============1145976182==
Content-Type: multipart/alternative; boundary=0016e64e909851edfe04772f51c5

--0016e64e909851edfe04772f51c5
Content-Type: text/plain; charset=ISO-8859-1

Hi there, I have around 50,000 or so word documents and I would like to
write a script to sort these files by author. The author is held as a
extended file attribute and so far I have not been able to find a way to
access this data. I have tried using the following Win32::OLE script to
extract these values. However under Windows 7 this does not return the
correct information. I am unsure wither this is because Windows 7 has
changed the file attribute structure, or because this method does not allow
me access to this data.

my $directory = $ARGV[0] || die "$pname requires directory as first
ar+gument\n";

find(\&main2, $directory);

sub main2{
if(-f $File::Find::name){
if(extention($File::Find::name) eq '.pdf'){
#print "File: $_ Extention: " . extention($_) . "\n";
my $shell = Win32::OLE->new("Shell.Application") or die;
my $folder = $shell->NameSpace("$File::Find::dir") or die;
my $file = $folder->ParseName("$_") or die;
for my $i (0..50){
my $attrib = $folder->GetDetailsOf($file, $i);
print "$i) $_ >> $attrib\n" if ! $attrib eq '';
}
print "-------------------------------------------\n";
}
}
}

[download]

I want to be able to access this value on pdf, doc & excel files types so if
you could point me in the direction of a module or thread on how I can
achieve this I would be forever grateful. Thanks and looking forward to your
response. Tim


--
Thanks,

Tim

--0016e64e909851edfe04772f51c5
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

'; font-size: medium; -webkit-border-horizontal-spacing: 2px; -webkit-b=
order-vertical-spacing: 2px; ">

Hi there, I have around 50,000 or so word=
documents and I would like to write a script to sort these files by author=
.. The author is held as a extended file attribute and so far I have not bee=
n able to find a way to access this data. I have tried using the following =
Win32::OLE script to extract these values. However under Windows 7 this doe=
s not return the correct information. I am unsure wither this is because Wi=
ndows 7 has changed the file attribute structure, or because this method do=
es not allow me access to this data.


ize=3D"-1">my $directory =3D $ARGV[0] || die "$pname requires director=
y as first ar
+gument\n";=20

find(\&main2, $directory);

sub main2{
if(-f $File::Find::name){
if(extention($File::Find::name) eq '.pdf'){
#print "File: $_ Extention: " . extention($_) . "=
;\n";
my $shell =3D Win32::OLE->new("Shell.Application"=
) or die;
my $folder =3D $shell->NameSpace("$File::Find::dir"=
;) or die;
my $file =3D $folder->ParseName("$_") or die;
for my $i (0..50){
my $attrib =3D $folder->GetDetailsOf($file, $i);
print "$i) $_ >> $attrib\n" if ! $attrib eq=
'';
}
print "-------------------------------------------\n"=
;
}
}
}

ext-align: left; display: block; padding-top: 0px; padding-right: 0px; padd=
ing-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; mar=
gin-bottom: 0px; margin-left: 0px; ">
laycode;node_id=3D804237;part=3D1" style=3D"font-size: smaller; color: rgb(=
153, 51, 51); ">[download]
I want to be able to acces=
s this value on pdf, doc & excel files types so if you could point me i=
n the direction of a module or thread on how I can achieve this I would be =
forever grateful. Thanks and looking forward to your response. Tim



--
Thanks,

Tim


--0016e64e909851edfe04772f51c5--

--===============1145976182==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============1145976182==--