Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Xmodem stuff under perl

by lindex (Friar)
on Oct 06, 2000 at 04:12 UTC ( [id://35500]=perlquestion: print w/replies, xml ) Need Help??

lindex has asked for the wisdom of the Perl Monks concerning the following question:

Ok, I am working on a script that dials up to this ancient dialin mailbox service. This service has its own exchange protocol and Iam useing Expect to handle this. There is but one issue to this little program, I have to use X/Y/Zmodem to upload files (as data for the mail) and Iam wondering as to what is the best method to handle this, like maybe open "sz" and redirect its output to the modem's filehandle... any input ?




lindex
/****************************/ jason@gost.net, wh@ckz.org http://jason.gost.net /*****************************/

Replies are listed 'Best First'.
Re: Xmodem stuff under perl
by isotope (Deacon) on Oct 06, 2000 at 04:21 UTC
    I would highly recommend using Zmodem because of its built-in CRC and handshaking, but the big problem you're going to run into is that Zmodem requires bidirectional communication. Just sending the output of sz to the modem's filehandle won't do any good unless sz has access to data coming in from the modem as well. Fortunately, I think you can get Expect to connect two spawned processes together. I think the $object->interact() method of Expect will do what you want, but the documentation isn't terribly helpful. Assuming you already have an Expect object for your modem, you should be able to use something like IPC::Open2 to open a bidirectional filehandle for sz, then call interact on that filehandle. You shouldn't need to set the escape sequence, because you should get an EOF when sz is done.

    --isotope
    http://www.skylab.org/~isotope/

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://35500]
Approved by root
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2024-04-23 13:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found