Beefy Boxes and Bandwidth Generously Provided by pair Networks DiBona
No such thing as a small change
 
PerlMonks  

Re: Network Neighborhood and LWP::UserAgent list directory

by lestrrat (Deacon)
on Aug 30, 2001 at 22:06 UTC ( [id://109221]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


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

Is this M$ Network Neighborhood stuff? I didn't know about this 'feature' until I read this node, but I would assume this doesn't actually involve HTTP, does it?

My guess is that since Windoze treats Network Neighborhood files/folders as local, when you type "file://..." the browser is only going to the OS ( i.e., not network activity from the browser's perspective) to ask for the file, thinking that is a local file?

If so, the reason why LWP fails to find these files is because LWP tries to talk HTTP to find the files on the peer machine, and since a regular Windoze workstation don't come with an HTTP server, the attempt fails.

I don't have ActivePerl installed on my Win2k so I can't try it, but I'd almost think that on a Network Neighborhood - equipped Win box, you can achieve the same effect by using a regular file open() ? Just a wild guess.

  • Comment on Re: Network Neighborhood and LWP::UserAgent list directory

Replies are listed 'Best First'.
Re: Re: Network Neighborhood and LWP::UserAgent list directory
by LeGo (Chaplain) on Aug 30, 2001 at 22:22 UTC
    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

      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.
      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://109221]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.