Beefy Boxes and Bandwidth Generously Provided by pair Networks Bob
Syntactic Confectionery Delight
 
PerlMonks  

Re^2: Cannot acces a remote file

by chennaiite (Sexton)
on Aug 22, 2005 at 06:09 UTC ( #485618=note: print w/ replies, xml ) Need Help??


in reply to Re: Cannot acces a remote file
in thread Cannot acces a remote file

Thanks Roger.... I tried both...but no result...

It throws cannot open the remote file invalid argument....

Is there anyother way to access the remote file.....

Just I want to copy the remote file to local and then make changes,Finally save new updated file in remote place...


Comment on Re^2: Cannot acces a remote file
Re^3: Cannot acces a remote file
by Roger (Parson) on Aug 22, 2005 at 06:13 UTC
    How is the remote drive exported in the first place? Can you browse it at all? Why don't you open the explorer session, and manually browse to the location of the file under the NETWORK NEIGHBOURHOOD, and grab the fullpath name in the address bar. Then apply the double backslash bits to make it work?

Re^3: Cannot acces a remote file
by sk (Curate) on Aug 22, 2005 at 06:15 UTC
    chennaiite,

    open cannot authenticate to the server for you.

    1. Make the changes roger has mentioned (i guess you have done that already)

    2. Now go to start->RUN and then type \\IP_ADDRESS (corresponding to your server)

    3. It will ask you to authenticate, type login and password

    4. Now try you perl script again

    I tried to access the files from one of my computers on my network and i get Invalid argument at -e line 1.

    Ignore the -e part as i was using command line perl. After I authenticated with the machine like the way i just explained i was able to access the file

    Hope this helps. I am not sure how windows's fileserver works with authentication and hence don't know ways to automate it.

    On the other hand you can also map your network server to a drive and try to see if that works better for you?

    update: if you don't know what path to use, just start->run type the ip_address\ and then browse to the directories. In windows explorer if you have turned on "address" bar then you can copy that into your open call. Just make sure you escpate \ with \\

    cheers

    SK

Re^3: Cannot acces a remote file
by davidrw (Prior) on Aug 22, 2005 at 06:17 UTC
    Does the remote machine have an FTP server (and this file available through it)? If so, this task would be very easy with Net::FTP. But if not, as Roger says you need to determine how the file is shared by windows.
Re^3: Cannot acces a remote file
by strat (Canon) on Aug 22, 2005 at 07:35 UTC

    It seems you first have to mount a share on the other server... try Win32::NetResource from CPAN, that does a good job

    If you want to find out what to do, try the dosbox command

    net use z: \\172.22.1.73\D$ /user:administrator secret

    (if secret is the password). If you type \\172.22.1.73 in your windows explorer and you see the share (e.g. with the name d), then use something like

    net use z: \\172.22.1.73\D /user:me secret

    (net help use gives you more information about this)

    If that works fine, you've got enough information to mount it with Win32::NetResource

    Best regards,
    perl -e "s>>*F>e=>y)\*martinF)stronat)=>print,print v8.8.8.32.11.32"

      It seems you first have to mount a share on the other server.
      Perl's open can handle UNC paths, but that's true if you need to login as someone different than on the current machine

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (6)
As of 2014-04-20 12:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (485 votes), past polls