> -----Original Message----- > From: Rob Dixon [mailto:[EMAIL PROTECTED] > Sent: Thursday, August 23, 2007 03:38 > To: beginners@perl.org > Cc: Wagner, David --- Senior Programmer Analyst --- WGO > Subject: Re: File Creator under WIN32 environment > > 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; > } > > Rob, Thanks. I installed, but it failed. Needed Class::Prototyped ( at least 0.98 version ). Installed that and reran, but this time failed on Data::Bitmask not being there. So installed that and voila, got the owner. I will try it with the processing I am doing. At this point, I was using backticks and ls -l filename to get each file I needed which seemed like a lot of overhead to just get the owner of a file.
I appreciate the input and will give it a shot since I have one set of files on a 300 gig DASD setup which I need to go through and the owner is one of the requirements. Everything else I can get from File::find or stat, but this which seems like it should be something relative easy was not there. Again thanks for the time and effort. Wags ;) ********************************************************************** This message contains information that is confidential and proprietary to FedEx Freight or its affiliates. It is intended only for the recipient named and for the express purpose(s) described therein. Any other use is prohibited. ********************************************************************** -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/