From: Roee F. <Roe...@mo...> - 2004-07-18 12:02:46
|
Hello! =20 Sorry if what I ask is FAQ, or simple, I'm totally newbie WRT Expect. =20 I have a script which runs from a Linux computer, connects to a windows computer via nc, and initiates a copy session. The problem is changing the initiator computer - the one that's running the script. From one computer the copying is ending successfully, but from a second one it times out. What I mean is that the copying on the target computer is finishing fine, but Expect on one of the Linux computers times out, and reports failure. One of the files being copied is a very large one (700MB), and when removing it from the source directory, the copy goes fine on both of the initiators. Also, when removing some of the subdirectories the copy is OK. =20 When running expect with debugging options, it seems that the output from the windows initiated computer, is kind of stuck. How can I debug the problem? (I've checked the dependent modules, IO::Pty, IO::Tty, POSIX, Fcntl, IO::Handle, and they appear to be the same on both of the computers) =20 Thanks!! =20 This is the script: #!/usr/bin/perl =20 use strict; use warnings; =20 use Expect; =20 my $command =3D Expect->spawn("nc dl380-02 4444") or die "Cannot = spwan\n"; $command->debug(3); $command->exp_internal(1); print "Spawned\n"; die "Did not find prompt" unless $command->expect(10, "WINNT"); print "found prompt\n"; $command->send("xcopy /Y /E /H /I E:\\tools F:\\tools\n\r"); $command->expect(180, "copied"); print "Error: ".$command->exp_error()."\n\n\n"; |