David Wagner wrote:

        Need to get the individual who created the file I am looking at.
I am using File::Find to get all files that are 4 days or younger. I can
get all info: Path, file name, file size, date modified easily except
owner. I have looked at the Perl doc ( using AS 5.8.8 build 820 ). I see
that I can invoke from within the Perl 'ls -l' using backticks, but is
there any other way of getting that info besides this? The File::Find is
working great, but mssing that last piece. Looked at CPAN, but either
asking the wrong question or not narrowing it enough. It is searching a
300 gig disk and at this point I have been running remotely which is
running at about 2.5 hours to go through all the files. I hopefully will
be able to run locally to accomplish the task.

        Any insights would be greatly appreciated on getting owner of a
file under Win32.

Hi David.

I just put this together. Does it help? The Win32::Security::NamedObject
class is part of the Win32::Security module.

Rob


use strict;
use warnings;

print file_owner('C:\boot.ini');



use Win32::Security::NamedObject;

sub file_owner {

 my $file = shift;

 my $ob = Win32::Security::NamedObject->new('FILE', $file);
 return $ob->ownerTrustee;
}


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to