FAQ
I have a perl script that uses file::copy to copy files from a server
to the local machine. It does alot more then that but is pretty much
the jist of what is taking place. Currently i have to have the local
machine first establish the connection so that authentication takes
place.

start -> run
\\server\path\share

Auth Window pops up, i enter the authentication.
Now i can run my script.

I want the script to handle the connection.

Any suggestions?

Search Discussions

  • JupiterHost.Net at Jan 11, 2005 at 5:33 pm

    Paul Kraus wrote:
    I have a perl script that uses file::copy to copy files from a server
    Funny, I couls only find File::Copy on cpan but no file::copy :)
    to the local machine. It does alot more then that but is pretty much
    the jist of what is taking place. Currently i have to have the local
    machine first establish the connection so that authentication takes
    place.

    start -> run
    \\server\path\share

    Auth Window pops up, i enter the authentication.
    Now i can run my script.

    I want the script to handle the connection.

    Any suggestions?
    Yes, post working code that dispalys this behavior :)

    http://search.cpan.org/~nwclark/perl-5.8.6/lib/File/Copy.pm doesn't work
    with remote file transfers unless I'm missing something...

    Probably you want Net::FTP, or if you want to interact with the prompt
    expect of some kind may work, or LWP if its via http

    Basically the code is essential because File::Copy doesn't have anythign
    to do with what you're describing and there's no way to answer your
    question without having a context to figure out what you're asking.
  • Jenda Krynicky at Jan 11, 2005 at 6:07 pm
    From: Paul Kraus <paul.kraus@gmail.com>
    I have a perl script that uses file::copy to copy files from a server
    to the local machine. It does alot more then that but is pretty much
    the jist of what is taking place. Currently i have to have the local
    machine first establish the connection so that authentication takes
    place.

    start -> run
    \\server\path\share

    Auth Window pops up, i enter the authentication.
    Now i can run my script.

    I want the script to handle the connection.
    use Win32::FileOp qw(Map);

    Map '' => '\\\\server\share', {user => ..., passwd => ...}
    or die "Can't connect to \\\\server\\share: $^E\n";

    copy( $from => $to);

    You might also use the Win32::FileOp::Copy()/CopyConfirm()/CopyEx()
    if you wanted confirmation and progress dialogs and such stuff.

    HTH, Jenda
    ===== Jenda@Krynicky.cz === http://Jenda.Krynicky.cz =====
    When it comes to wine, women and song, wizards are allowed
    to get drunk and croon as much as they like.
    -- Terry Pratchett in Sourcery

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupbeginners @
categoriesperl
postedJan 11, '05 at 4:46p
activeJan 11, '05 at 6:07p
posts3
users3
websiteperl.org

People

Translate

site design / logo © 2022 Grokbase