tags:

views:

119

answers:

4

Hi... I did an application that create a partintion and format the disk using system calls...

In the middle of the process there is a query asking to type the size of the disk... What can i do in my application in order to automaticly answer that query??

can you please help me?

A: 

fortunately, There is nothing you can do. :)

M. Jahedbozorgan
Why do you say so? Why "fortunately"? Anyway, it is false, there are many ways to talk with a program from another program.
bortzmeyer
A: 

Depending on your operating system (windows can do it for instance) you can have the stdin for the programmed redirected to come from an output of your program.

Myforwik
A: 

Maybe you can use system() do run utilities like expect to control the process

ZelluX
+1  A: 

This is certainly possible with, for instance libexpect but I never tried it (but Google found what seems to be a good example). On my Debian machine, man libexpect says:

    libexpect - programmed dialogue library with interactive programs

    This  library  contains functions that allow Expect to be used as a Tcl
    extension or to be used directly from C or C++ (without  Tcl).
bortzmeyer