I work on a CPAN module interfacing the proprietary 'cleartool': ClearCase::Argv
I am interested in the mode in which it forks a background process, using IPC::Open3, and sends it requests.
This works mostly fine, but I now meet a problem on Windows, and specifically with interactive comments: certain commands will request a comment from the user.
My problem: the mechanism which successfully reads the replies fails to return me the prompt: it hangs.
I don't know what to suspect: flushing, line termination...?
The code works on unix, and on Windows for non interactive commands.
Here are a few shell inliners showing the problem. The 'layer' used with binmode affects as well (:crlf, :win32 :utf8, etc.).
Most cases, I had to interrupt. The others returned, but with no visible ouput (CR evaluation?)
My prompt shows the drive mapped to a ClearCase 'dynamic view'. The command I use replaces a comment in a README file found locally. I give first an example of the dialog as it happens directly on the command line. I end my answer with a line containing a single '.'.
O:\atcctest\ClearCase-Argv>cleartool chevent -rep README
Comments for "README":
.
Modified event of version "README".
The 'prompt' I expect to read is thus here 'Comment for "README":'
O:\atcctest\ClearCase-Argv>perl -MIPC::Open3 -e open3($i,$o,0,qw(clear
+tool));binmode $o, q(:crlf);print $i qq(chevent -rep README\n);$a=<$o
+>;print $i qq(.\n);chomp($a);$a=~s/\r\n?$//;print qq($a\n);print $i q
+(exit\n)"
Terminating on signal SIGINT(2)
O:\atcctest\ClearCase-Argv>perl -MIPC::Open3 -e open3($i,$o,0,qw(clear
+tool));binmode $o, q(:win32);print $i qq(chevent -rep README\n);$a=<$
+o>;print $i qq(.\n);chomp($a);$a=~s/\r\n?$//;print qq($a\n);print $i
+qq(exit\n)"
O:\atcctest\ClearCase-Argv>perl -MIPC::Open3 -e open3($i,$o,0,qw(clear
+tool));binmode $o, q(:utf8);print $i qq(chevent -rep README\n);$a=<$o
+>;print $i qq(.\n);chomp($a);$a=~s/\r\n?$//;print qq($a\n);print $i q
+q(exit\n)"
Terminating on signal SIGINT(2)
O:\atcctest\ClearCase-Argv>perl -MIPC::Open3 -e open3($i,$o,0,qw(clear
+tool));binmode $o, q(:bytes);print $i qq(chevent -rep README\n);$a=<$
+o>;print $i qq(.\n);chomp($a);$a=~s/\r\n?$//;print qq($a\n);print $i
+qq(exit\n)"
Terminating on signal SIGINT(2)
O:\atcctest\ClearCase-Argv>perl -MIPC::Open3 -e open3($i,$o,0,qw(clear
+tool));binmode
$o, q(:unix);print $i qq(chevent -rep README\n);$a=<$o>;print $i qq(.\
+n);chomp($a);$a=~s/\r\n?$//;print qq($a\n);print $i qq(exit\n)"
Terminating on signal SIGINT(2)
O:\atcctest\ClearCase-Argv>perl -MIPC::Open3 -e open3($i,$o,0,qw(clear
+tool));binmode $o, q(:unix crlf);print $i qq(chevent -rep README\n);$
+a=<$o>;print $i qq(.\n);chomp($a);$a=~s/\r\n?$//;print qq($a\n);print
+ $i qq(exit\n)"
Terminating on signal SIGINT(2)
O:\atcctest\ClearCase-Argv>perl -MIPC::Open3 -e open3($i,$o,0,qw(clear
+tool));binmode $o, q(:unix stdio);print $i qq(chevent -rep README\n);
+$a=<$o>;print $i
qq(.\n);chomp($a);$a=~s/\r\n?$//;print qq($a\n);print $i qq(exit\n)"
Do I miss something obvious?
Non obvious?
Thanks,
Marc
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.