Ok ...  I see what you are saying.  I think I was a bit confused at first so
I apologize.  Perhaps you can find the module creator.  I would assume it
would return 0 if the share is not found.  So yes that makes no sense :)

-Mike


-----Original Message-----
From: Shea, Linchi [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 20, 2001 10:13 AM
To: '[EMAIL PROTECTED]'
Subject: RE: Win32::NetResource::AddConnection


Well, the function call is supposed to create a deviceless connection to the
share. I expect the function to fail and return 0 if I have removed share E$
from server dts_server2.
But in all my tests, the function always returns 1.

Linchi 

> -----Original Message-----
> From: Michael Marziani [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, March 20, 2001 11:00 AM
> To: 'Shea, Linchi'; '[EMAIL PROTECTED]'
> Subject: RE: Win32::NetResource::AddConnection
> 
> 
> I just looked at the NetResource module and they are all just straight
> functions.  Your format:
> 
> my $rc = Win32::NetResource::AddConnection( { 
>           RemoteName => "\\\\DTS_SERVER2\\E\$" } );
> 
> is similar to what you would do with an object-method based 
> module such as
> Win32:Perms.  There you must create objects with the form you use:
> 
> my $perm_object = new Win32::Perms("\\\\foo\bar");
> 
> However, for the NetResource module, this is not the expected 
> execution.
> The AddConnection function doesn't create an object or 
> anything, it just
> adds the connection you ask it to.  It returns a value of 0 
> for failure or 1
> for success, which is why $rc = 1.
> 
> -Mike
> 
> __________________________________________
> Michael Marziani
> Systems Administrator - OnFiber Communications
> Phone: 512.651.7455     Fax: 512.651.7327
> 
> 
> -----Original Message-----
> From: Shea, Linchi [mailto:[EMAIL PROTECTED]]
> Sent: Monday, March 19, 2001 4:37 PM
> To: [EMAIL PROTECTED]
> Subject: Win32::NetResource::AddConnection
> 
> 
> In the following code segment, $rc is always set to 1 even when I have
> removed the share from the server.
> 
> my $rc = Win32::NetResource::AddConnection( { 
>           RemoteName => "\\\\DTS_SERVER2\\E\$" } );
> print "$rc\n";
> 
> Is this a known issue with AddConnection for ActivePerl 
> 5.005_003 Binary
> build 522?
> 
> Linchi 
> 
> _______________________________________________
> Perl-Win32-Admin mailing list
> [EMAIL PROTECTED]
> http://listserv.ActiveState.com/mailman/listinfo/perl-win32-admin
> _______________________________________________
> Perl-Win32-Admin mailing list
> [EMAIL PROTECTED]
> http://listserv.ActiveState.com/mailman/listinfo/perl-win32-admin
> 

_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-admin
_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-admin

Reply via email to