From: Austin S. <te...@of...> - 2003-08-04 22:06:28
|
On Mon, Aug 04, 2003 at 05:19:18PM -0400, Sayre Swarztrauber wrote: > I am new to Expect. I am using it to control some serial devices that > our company manufactures. They are connected on /dev/tty ports directly > as RS232 devices. I open the port using IO::File and then connect that > handle to Expect. > > I have a problem where Expect.pm occasionally closes the filehandle on > the port giving the following message from the debug output: > > Waiting for new data (6 seconds)... > handle id(3): new data. > handle id(3): EOF > handle id(3): closing... > Returning from expect with TIMEOUT or EOF > > > I have patched my problem by commenting out the > > $exp->hard_close(); > > on line 853 of Expect.pm - which I realize is a drastic step. > > What am I doing wrong? Why would expect decide to close my filehandle? > What can I do about it so that I do not have to modify the Expect.pm > program. I concur, this doesn't seem like something that should be done during expect(). It should be up to the user to close the filehandle. Also while checking this out I noticed: # ugly hack for broken solaris ttys that spew <blank><backspace> # into our pretty output $buffer =~ s/ \cH//g; should probably either be somewhere else or have a non-default flag for turning it on. Users should be able to expect 8-bit clean data by default - at least when the handle isn't a pty. Austin |