Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Re: Network Neighborhood and LWP::UserAgent list directory

by LeGo (Chaplain)
on Aug 31, 2001 at 02:22 UTC ( [id://109225]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://109225]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (7)
As of 2024-03-28 11:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found