boat73 has asked for the wisdom of the Perl Monks concerning the following question:
use Win32::Lanman; $server = "$ARGV[0]"; if(!Win32::Lanman::NetFileEnum($server, '', '', \@infos)) { print "Sorry, something went wrong; error: "; # get the error code print Win32::Lanman::GetLastError(); exit 1; } foreach (@infos){ if(($${_}{permissions} == "1") || ($${_}{permissions} == "9")){$ac +cess = "Read";} elsif($${_}{permissions} == "35"){$access = "Read Write";} else{$access = "Unknown";} print "[" . $${_}{id} . "] " . $${_}{pathname} . "\n\tUser:\t" . $ +${_}{username} . "\n\tLocks:\t" . $${_}{num_locks} . "\n\tAccess:\t" +. $access . "\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: perl version of runas
by NetWallah (Canon) on Jan 05, 2005 at 20:45 UTC |