in reply to Re: Network Neighborhood and LWP::UserAgent list directory
in thread Network Neighborhood and LWP::UserAgent list directory

I am using Win2k and went to try the following...

#!d:\perl\bin\perl.exe -w use strict; my $dir = 'file:/IP/'; opendir (DIR, $dir) or die "cannot opendir $dir"; foreach (readdir(DIR)){ #do something }

This gave me the "cannot opendir"... response.

I do agree with what you are saying with your response but I don't know what to do.

LeGo

Replies are listed 'Best First'.
Re: Re: Re: Network Neighborhood and LWP::UserAgent list directory
by $code or die (Deacon) on Aug 31, 2001 at 03:24 UTC
    Why not just use a UNC...

    #!d:\perl\bin\perl.exe -w use strict; my $server = "192.168.0.5"; # or something my $dir = "\\\\$server\\c\$\\temp"; # open c:\temp on $server opendir (DIR, $dir) or die "cannot opendir $dir"; foreach (readdir(DIR)){ #do something }
    I am not sure if this works - I think it does - I know it works if $server is the actual Win32::NodeName(). And I know that you can type "\\ip.address\c$\temp" in the Start > Run dialogue box.

    If this fails, then just share the remote path use Win32::NetResource

    Of course, all this depends on you having read permissions on the remote machine.

    Error: Keyboard not attached. Press F1 to continue.
Re (tilly) 3: Network Neighborhood and LWP::UserAgent list directory
by tilly (Archbishop) on Aug 31, 2001 at 07:59 UTC
    I know I sound like a broken record on this, but you would be likely to get a more informative error if your error message included the contents of $! (the last error generated by the OS). This advice is straight out of perlstyle.