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 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
In our previous episode, Marcos Douglas said:
> > My second question:
> > Why the compiler do not found the units in
> > \freepascal\lib\synapse\src\trunk\units\i386-win32 if I use the
> > compiler option Fu (in Lazarus is Other Units Files -Fu)? In
> > this folder there exists all .ppu and .o comp
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.
___
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
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
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:
> > 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:
> > > 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:
> 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
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.
Ludo
-Message d'origine-
De : fpc-pascal-boun...@lists.freepascal.
Correction: 'Anton'#13#10 is read from stdout. More adds the CR. Windows
style EOL ...
Ludo
-Message d'origine-
De : fpc-pascal-boun...@lists.freepascal.org
[mailto:fpc-pascal-boun...@lists.freepascal.org] De la part de Ludo Brands
Envoyé : dimanche 8 mai 2011 19:06
À : 'FPC-Pascal users
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
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
Anton,
I don't see where you close the mProcess.input.
I tried several things myself which didn't work:
- ctrl Z Return is an eof when you run more in a cmd window.
- call explicitly CloseHandle(mProcess.Input.Handle);
Pipes.pp doesn't have any routines to clean up the pipe handles which is
acc
The handles are mProcess.Input.Handle and mProcess.Output.Handle
Ludo
-Message d'origine-
De : fpc-pascal-boun...@lists.freepascal.org
[mailto:fpc-pascal-boun...@lists.freepascal.org] De la part de Anton
Shepelev
Envoyé : dimanche 8 mai 2011 19:27
À : FPC-Pascal users discussions
Objet :
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
That's what I tried already. It simply echoes the ^Z (right arrow).
I tried also to close the pipe explicitly from the sender side without
success:
mProcess.CloseInput;
CloseHandle(mProcess.Input.Handle);
I'm afraid we're looking at a problem with more.com waiting until the
process releases the
Anton,
According to msdn
http://msdn.microsoft.com/en-us/library/aa365782%28v=vs.85%29.aspx the pipe
handles should be created non-inheritable in order to detect EOF. Looking at
fcl-process/src/win/pipes.inc, pipes are created inheritable... The msdn
sample code to redirect input and output also c
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
Ok, I have looked at the example that was the slowest: 5 times slower than gcc.
k-nucleitide:
http://shootout.alioth.debian.org/u32/benchmark.php?test=knucleotide&lang=all
The C++ code is giving me headaches from only looking at it. I am
still not sure what the hell they have done (or cheated) t
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
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
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
24 matches
Mail list logo