in reply to Zmodem and Net::Telnet
Assuming I understand correctly, you want to execute rz on the remote side and sz on the local side. You can do this with something similar to the spawn() routine given in the Net::Telnet docs. Here's something I just cobbled together that is fairly close to what I think should work (completely untested):
# get the remote end ready to receive $nt->print "rz\r"; use IO::Pty (); $pty = new IO::Pty or die $!; ## Execute sz in another process. unless ($pid = fork) { # child process die "problem spawning program: $!\n" unless defined $pid; ## Disassociate process from existing controlling terminal. use POSIX (); POSIX::setsid or die "setsid failed: $!"; ## Associate process with a new controlling terminal. my $tty = $pty->slave; my $tty_fd = $tty->fileno; close $pty; ## Make stdio use the new controlling terminal. open STDIN, "<&$tty_fd" or die $!; open STDOUT, ">&$tty_fd" or die $!; open STDERR, ">&STDOUT" or die $!; close $tty; exec "sz @filenames" or die "problem executing sz\n";" }
In any case, that's the gist of how it should work.
update: oh, this assumes that you have sz on your end. You said the remote side was a linux box. If the local side is also linux, this should work fine. If you're running windows or something else, caveat lector! :-)
|
|---|