Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Win32::NetResource Question

Status
Not open for further replies.

timtrust123

Programmer
Dec 19, 2003
19
GB
I have spent this sunny afternoon in London trying to get perl to link up to a network share (NT Server) and simply lits the files in the shares root directory. My investigation so far tells me that Net resource is the way to go and I even get a sucess when connecting. However i'm unable to list the files on the share. Its not a permissions problem (been there). Any ideas out there . Here is my code...
use Win32::NetResource;
my %NetResource = (
RemoteName => "\\\\server\\hiddenshare\$"
);
my $user = "user";
my $password = "password";

if (Win32::NetResource::AddConnection(\%NetResource, $password, $user, 1))
{
print "Connection made\n";
foreach $file (<*>){print "$file\n"};
}

Cheers
Tim
 
Tim

Code:
foreach $file (<*>){print "$file\n"};

I assume you're getting the connection made, but I can't see where you're reading from a directory handle?

I can't see anything relevant on the dox from CPAN

--Paul




It's important in life to always strike a happy medium, so if you see someone with a crystal ball, and a smile on their face ...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top