Sorry, I forgot to say the patch is against verstion
2.4.2.
Anton
___
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Michael Van Canneyt:
> The interface of the pipes unit can be changed
> with a parameter with a default value, so existing
> code continues to work.
Yes, but all the platform-specific pipe.inc files
and pipes.pp will have to be changed anyway because
the CreatePipeHandles will have a di
On Thu, 19 May 2011, Anton Shepelev wrote:
Ludo Brands:
You can file a bug at http://bugs.freepascal.org/.
This is bug #0019325.
...
I thought about writing a patch, but it seems that it is not
enough to modify the implementation of the Windows-specific
pipes.inc.
The correct way to cre
Ludo Brands:
> You can file a bug at http://bugs.freepascal.org/.
This is bug #0019325.
...
I thought about writing a patch, but it seems that it is not
enough to modify the implementation of the Windows-specific
pipes.inc.
The correct way to create pipes for the three channels (out,
in and er
A little update on the subject.
Ludo Brands wrote:
> If you run 'more' in a cmd window you'll notice that
> 'more' echoes the input but only sends to stdout when a
> return is entered. I modified the program to send
> 'Anton'#10 and the program reads back 'Anton'#10 from std-
>
On 09/05/11 12:04, Anton Shepelev wrote:
Ludo Brands:
If you need these handles from the child process use:
InHnd:=GetStdHandle(STD_INPUT_HANDLE);
OutHnd:=GetStdHandle(STD_OUTPUT_HANDLE);
ErrHnd:=GetStdHandle(STD_ERROR_HANDLE);
Thank you, that's what I need.
By the way, it does work in a sim
Ludo Brands:
> If you need these handles from the child process use:
> InHnd:=GetStdHandle(STD_INPUT_HANDLE);
> OutHnd:=GetStdHandle(STD_OUTPUT_HANDLE);
> ErrHnd:=GetStdHandle(STD_ERROR_HANDLE);
Thank you, that's what I need.
By the way, it does work in a simple single-process applica-
tion:
Ludo Brands:
> You can file a bug at http://bugs.freepascal.org/
OK.
> Dupicating handles isn't apparently the only solution. The
> msdn sample creates non-inheritable pipes and hands these
> handles simply over to createprocess, without duplicating.
There are two solutions, but only of them
-boun...@lists.freepascal.org] De la part de Ludo Brands
Envoyé : lundi 9 mai 2011 07:51
À : 'FPC-Pascal users discussions'
Objet : RE : RE : RE : [fpc-pascal] Redirecting input to a child process
Pipe handles can be used directly with readfile:
Var BytesRead:Longword;
windows.Readfile(mProcess.Outpu
011 00:22
À : fpc-pascal@lists.freepascal.org
Objet : Re: [fpc-pascal] Redirecting input to a child process
I wrote:
> I'll try duplicating the handles and report the results.
Yes. It works now. I am creating a non-inheritable handle using
CreatePipe, then duplicating it to an inheritable o
-boun...@lists.freepascal.org
[mailto:fpc-pascal-boun...@lists.freepascal.org] De la part de Anton
Shepelev
Envoyé : dimanche 8 mai 2011 22:26
À : FPC-Pascal users discussions
Objet : Re: RE : RE : [fpc-pascal] Redirecting input to a child process
Ludo Brands:
> > Connected with this remark, is there a way
On 5/8/2011 16:16, Anton Shepelev wrote:
waldo kitty:
how about sending the ^Z line the CRLF is being sent to
indicate line breaks??
This I had tried even before posting the question :)
i wasn't sure and the posts didn't seem to indicate this so i thought i'd ask ;)
now i'll go back to
I wrote:
> I'll try duplicating the handles and report the results.
Yes. It works now. I am creating a non-inheritable handle
using CreatePipe, then duplicating it to an inheritable one
using DuplicateHandle and pass the duplicate to the
CreateProcess funtion.
Does this mean that th
Ludo Brands:
> > Connected with this remark, is there a way to get the
> > underlying StdIn handle in a FreePascal program, so as
> > to read from it per-character, or any other way using
> > the OS's routines?
>
> The handles are mProcess.Input.Handle and mProcess.Out-
> put.Handle
I
waldo kitty:
> how about sending the ^Z line the CRLF is being sent to
> indicate line breaks??
This I had tried even before posting the question :)
Ludo Brands:
> I don't see where you close the mProcess.input.
In my original post I call:
MoreProcess.CloseInput();
As for the progra
users discussions
Objet : RE : [fpc-pascal] Redirecting input to a child process
Ludo Brands:
> If you run 'more' in a cmd window you'll notice that 'more'
> echoes the input but only sends to stdout when a
> return is entered. I modified the
d".
Ludo
-Message d'origine-
De : fpc-pascal-boun...@lists.freepascal.org
[mailto:fpc-pascal-boun...@lists.freepascal.org] De la part de waldo kitty
Envoyé : dimanche 8 mai 2011 20:29
À : fpc-pascal@lists.freepascal.org
Objet : Re: RE : [fpc-pascal] Redirecting input to a child
On 5/8/2011 13:17, Anton Shepelev wrote:
Ludo Brands:
If you run 'more' in a cmd window you'll notice that
'more' echoes the input but only sends to stdout when a
return is entered. I modified the program to send
'Anton'#10 and the program reads back 'Anton'#10 from
stdou
Objet : Re: RE : [fpc-pascal] Redirecting input to a child process
Ludo Brands:
> If you run 'more' in a cmd window you'll notice that 'more'
> echoes the input but only sends to stdout when a
> return is entered. I modified the program to se
s.freepascal.org] De la part de Anton
Shepelev
Envoyé : dimanche 8 mai 2011 19:18
À : FPC-Pascal users discussions
Objet : RE : [fpc-pascal] Redirecting input to a child process
Ludo Brands:
> If you run 'more' in a cmd window you'll notice that 'more'
>
Ludo Brands:
> If you run 'more' in a cmd window you'll notice that
> 'more' echoes the input but only sends to stdout when a
> return is entered. I modified the program to send
> 'Anton'#10 and the program reads back 'Anton'#10 from
> stdout.
Connected with this remark, is
Ludo Brands:
> If you run 'more' in a cmd window you'll notice that
> 'more' echoes the input but only sends to stdout when a
> return is entered. I modified the program to send
> 'Anton'#10 and the program reads back 'Anton'#10 from
> stdout.
Thank you, Ludo, this is great
x27;FPC-Pascal users discussions'
Objet : RE : [fpc-pascal] Redirecting input to a child process
If you run 'more' in a cmd window you'll notice that 'more' echoes the input
but only sends to stdout when a return is entered. I modified the program to
send 'Anto
--Message d'origine-
De : fpc-pascal-boun...@lists.freepascal.org
[mailto:fpc-pascal-boun...@lists.freepascal.org] De la part de Marco van de
Voort
Envoyé : dimanche 8 mai 2011 18:06
À : FPC-Pascal users discussions
Objet : Re: [fpc-pascal] Redirecting input to a child process
In our previous episode, A
Marco van de Voort:
> I played a bit with it, but was unable to make it work. I
> added a writeln of outstream.size to the "running" while,
> and it seems output is written.
Many thanks :)
If I understood you correctly, you put
WriteLn(MoreProcess.Output.Size);
inside the waiting loop an
In our previous episode, Anton Shepelev said:
> > > shell, isn't the shell's input redirected to the
> > > program's?
> >
> > Maybe. I'm pretty sure about batchfiles, but never
> > tried programs, that's why I thought I'd mention
> > the observation.
>
> My program captures both the standard and
Marco van de Voort:
> > When executing command-line programs via the
> > shell, isn't the shell's input redirected to the
> > program's?
>
> Maybe. I'm pretty sure about batchfiles, but never
> tried programs, that's why I thought I'd mention
> the observation.
My program captures both the
In our previous episode, Anton Shepelev said:
>
> When executing command-line programs via the shell,
> isn't the shell's input redirected to the program's?
Maybe. I'm pretty sure about batchfiles, but never tried programs, that's
why I thought I'd mention the observation.
__
Marco van de Voort:
> Why do you execute over the shell? You now pipe
> your information into the shell (since that is
> what you execute directly), not the program.
Thanks for the note, Marco. Unfortunately, replacing
that line with the direct path to more.com had no
effect.
When exe
SteveG:
> This is working on Linux and WinXP
>
> I cut what I was hoping was just the relevant code
> from the unit, so it is missing a bit :)
Here's a full program made from this code:
http://pastebin.com/id90J1rY
It doesn't work for me in WinXP. What about you?
Anton
In our previous episode, Anton Shepelev said:
>MoreProcess.CommandLine := 'C:\WINDOWS\system32\cmd.exe /C more';
Why do you execute over the shell? You now pipe your information into the
shell (since that is what you execute directly), not the program.
___
On 08/05/11 17:30, Anton Shepelev wrote:
SteveG:
Anton - I have attached an extract from some work-
ing code (hopefully I didnt remove anything neces-
sary)
It may help you move on a bit further
I turned your piece of code into a complete program,
but it didn't work either. In fact, there
SteveG:
> Anton - I have attached an extract from some work-
> ing code (hopefully I didnt remove anything neces-
> sary)
> It may help you move on a bit further
I turned your piece of code into a complete program,
but it didn't work either. In fact, there is not
much difference between yo
On 08/05/11 05:38, Anton Shepelev wrote:
Hello all,
I have been experimenting with redirection of stan-
dard I/O of child processes using FreePascal 2.4.2
on Windows. I have succeeded in capturing standard
input and standard output, but failed to feed my own
data to the child's standard inp
Hello all,
I have been experimenting with redirection of stan-
dard I/O of child processes using FreePascal 2.4.2
on Windows. I have succeeded in capturing standard
input and standard output, but failed to feed my own
data to the child's standard input.
The child process doesn't seem to rec
35 matches
Mail list logo