I am trying to control ftp client from C program (OS X). I did fork and execve – process is started ok. The problem is with pipes – I can send command to ftp client process and get feedback from it just fine (If i send “help\n” i get back help output) but what I never get in pipe is “ftp> ” prompt. Any ideas?
Ivan
A program can examine
stdinto find out whether it’s a terminal or a pipe. In your case, the FTP program probably does that (for example to know whether it can use escape sequences to render progress bars or offer command line editing).If you really need the prompt, you have to look into PTYs (pseudo terminals) which emulate a console.