Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^2: How to Automate Response to Executable's Prompt?

by socrtwo (Sexton)
on Jun 11, 2012 at 21:50 UTC ( [id://975648]=note: print w/replies, xml ) Need Help??


in reply to Re: How to Automate Response to Executable's Prompt?
in thread How to Automate Response to Executable's Prompt?

The problem with -q is zip -FF just blows on through and doesn't repair my sample file with the pseudo split archive structure. So I can't use quiet mode without sacrificing what I'm trying to do.

OK so here is my IPC::Open3 statements so far:

use IPC::Open3; my ($pid,$zipin, $zipout, $ziperr); $pid = open3 ($zipin, $zipout, $ziperr, system("cmd /c zip.exe -FF \"$ +mainfilepath\" --out \"$ziprepairedwordfilepath\"")); wait; $zipin = print "y\r\n";

Any suggestion on how to construct wait or waitpid phrases? Right now whatever I do with wait or waitpid, printing 'y' into input, occurs after I enter 'y' by hand. $zipin never writes to the prompt.

Update

I'm looking of zip's C++ code in Visual Studio to see if I can compile my own version that always accepts that the archive is one disk.

Replies are listed 'Best First'.
Re^3: How to Automate Response to Executable's Prompt?
by bulk88 (Priest) on Jun 11, 2012 at 22:33 UTC
    $pid = open3 ($zipin, $zipout, $ziperr, system("cmd /c zip.exe -FF \"$ +mainfilepath\" --out \"$ziprepairedwordfilepath\""));
    Thats broken. system read that. And read IPC::Open3. Your calling open3 wrong.
    $zipin = print "y\r\n";
    Thats broken. print read that. Perhaps another monk can comment if the wait() is correct.
Re^3: How to Automate Response to Executable's Prompt?
by socrtwo (Sexton) on Jun 12, 2012 at 04:34 UTC

    Update: As I reported in another part of this thread, I was able to get zip to compile without asking if my corrupt docx files were single archives or not.

    Also note -q and any other option does not work with -F or -FF. The only thing that works is --out probably also -O or --output-file. One of those three are a requirement whenever using -F or -FF.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://975648]
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: (3)
As of 2024-04-25 17:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found