On Thu, 29 Nov 2007, Malcolm Poole wrote:

> Marc Weustink wrote:
> > Malcolm Poole wrote:
> > > Marc Weustink wrote:
> > > > Malcolm Poole wrote:
> > > > > Hello everyone!
> > > > >
> > > > > I am trying to write a front-end for the command-line archiving
> > > > > program
> > > > > "dar" ( http://dar.linux.free.fr/ )
> > > > >
> > > > > I can read happily from the dar Process.Output but am not managing to
> > > > > respond using Process.Input
> > > > >
> > > > > When extracting an archive using the commandline, when dar finds a
> > > > > file
> > > > > to be overwritten, it asks if it should be overwritten, to which the
> > > > > response is [RETURN] key  for 'Yes' or [ESC] key for  'NO'. I have
> > > > > tried
> > > > > writing both #13 and #27 to Process.Input but it has no effect: the
> > > > > program just hangs as the Process never stops running and gives no
> > > > > more
> > > > > output.
> > > >
> > > > Try writing #10 or #13#10
> > > >
> > > > Marc
> > > No, I've already tried that, and checked the dar source: it is definitely
> > > looking for one byte of input: #27 or '/n', which is #13.
> > IIRC newlines on unix are #10
> This is true, but unfortunately not the solution
> >
> > > Is it possible that it is ignoring stdin because it is not being run from
> > > a terminal?
> >
> > Thats possible too. But maybe it isn't reading stdin at all.
> I was beginning to suspect that this was possible (*sighs*). Looking again at
> the dar source I found the following:
>        // we do not use anymore standart input but open a new descriptor
>        // from the controlling terminal. This allow in some case to 
> keep use
>        // standart input for piping data while still having user interaction
>        // possible.
> Apart from the fact that it doesn't use stdin for interaction I'm afraid this
> is all a bit above me.
> 
> I suspect that this means that I am not going to be able to interact with dar
> using TProcess. Is this correct?

This is correct. If it uses accesses the terminal directly, there is little
you can do, except opening the terminal and trying to control it yourself,
but that's outside the scope of TProcess.

Michael.

_________________________________________________________________
     To unsubscribe: mail [EMAIL PROTECTED] with
                "unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to