At the Perl level, syswrite reports that all the data has been written. At the OS level, a process monitoring tool such as truss shows the write call also reporting that all the data has been written.

And BTW, the dropped data is not the chunk tail but the head!

update: this is the interaction between both processes at the OS level:

27168: write(4, "\0\0\00501\0\0\003", 9) = 9 27170: read(7, "\0\0\00501\0\0\003", 16384) = 9 27170: write(8, "\0\0\00502\0\0\003", 9) = 9 27168: read(4, "\0\0\00502\0\0\003", 16384) = 9 27168: write(4, "\0\0\0" 03\0\0\0\0\0\0\0\r/ t m ".., 38) = 38 27170: read(7, "\0\0\0" 03\0\0\0\0\0\0\0\r/ t m ".., 16384) = 38 27170: write(8, "\0\0\0\rf \0\0\0\0\0\0\004\0\0\0".., 17) = 17 27168: read(4, "\0\0\0\rf \0\0\0\0\0\0\004\0\0\0".., 16384) = 17 27168: write(4, "\0\0\015\n\0\0\001\0\0\004\0\0\0".., 25) = 25 27170: read(7, "\0\0\015\n\0\0\001\0\0\004\0\0\0".., 16384) = 25 27170: write(8, "\0\0\018e \0\0\001\0\0\0\0\0\0\0".., 28) = 28 27168: read(4, "\0\0\018e \0\0\001\0\0\0\0\0\0\0".., 16384) = 28 27168: write(4, "\0\0@ 1906\0\0\002\0\0\004\0\0\0".., 16413) = 16413 27170: read(7, "a l / l i b \nL I B C = \nL ".., 16384) = 1024
Note how reads and writes for both processes interleave until the last one where only 1024 bytes are read by the child and that those bytes do not correspond to the head of the last write operation performed on the parent!

In reply to Re^2: Expect and PTY dropping data by salva
in thread Expect and PTY dropping data by salva

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.