Hi everybody,

Two problems:

1. When I run this code:

_________________________________

#!/usr/bin/perl

 

use Win32::Perms;

use File::Find;

 

my $acount= user1;

my $dir1='c:\\temp';

 

 

find (\&wanted, $dir1);

 

sub wanted {

    if (-d){

        my $File  = new Win32::Perms("$File::Find::name")||die "$!"; 

        my $Own=$File->Owner($acount);

        print "$Own\t$File::Find::name\n";

        $File->Close();

    }

}

________________________________

I get:

 

____________________________________

TAU-CENTAUR\user1       c:\temp

TAU-CENTAUR\user1       c:\temp/user2

TAU-CENTAUR\user1       c:\temp/user2/New Folder

TAU-CENTAUR\user1       c:\temp/user1

TAU-CENTAUR\user1       c:\temp/user1/New Folder

TAU-CENTAUR\user1       c:\temp/tcpp101

TAU-CENTAUR\user1       c:\temp/citrix_files

TAU-CENTAUR\user1       c:\temp/certificate_files

________________________________________

 

When I add to code, in order to set the new ownership:

     $File->set();

 

I get :

________________________________________________________

Can't locate auto/Win32/Perms/set.al in @INC (@INC contains: C:/Perl/lib C:/Perl/site/lib .) at C:\scripts\owner.pl line 19.

________________________________________________________

What have I done wrong with set() syntax?

 

2. I have a profiles directory with subdirectories which their name is the username off my users. Under these files I need to have the ownership on each subdirectory to be with ownership as its directory name. how do I ad this feature to this script?

 

Cheers!

 

R o n e n   K f i r

System Administrator

CIT div. Tel Aviv University

Israel

Tel: 972-3-6407416

Fax: 972-3-6405158

cellular: 972-55-405910

E-mail: [EMAIL PROTECTED]

 

 

 

-----Original Message-----
From: Alan Dobkin [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 11, 2004 10:33 AM
To: [EMAIL PROTECTED]
Cc: Ronen Kfir
Subject: RE: Fileowners.pl

 

The best free utility I have seen for this purpose is SetACL:

http://setacl.sourceforge.net/

 

You could also use Dave Roth's Win32::Perms as Craig mentioned.

 

Alan

 

--On Thursday, March 11, 2004 10:05 AM +0200 Ronen Kfir

<[EMAIL PROTECTED]> wrote:

 

> I don't see how I can change ownership in subdirectories with it. All

> I see is the option of taking ownership. What I need is to change the

> ownership of some dozens subfolder to different user each. It is a

> profiles folder, so each subfolder name is the name of the user.

 

_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to