Re: [fpc-pascal] Ping problems - OS/X

2014-05-22 Thread Marco van de Voort
In our previous episode, Mattias Gaertner said: > > I did note that the example said that it was flawed, but, foolishly, > > as it turned out, I thought it meant 'flawed' rather than 'doesn't > > work at all'. > > Do you mean this example: > http://wiki.freepascal.org/Executing_External_Programs#A

Re: [fpc-pascal] Ping problems - OS/X

2014-05-21 Thread Saunders, Rich
On 2014-05-21 15:44, Peter Brooks wrote: I took AStringList.Add() to mean that it added the string to the list of strings - I was wrong.. How were you wrong about that? That's exactly what it does. Looks to me you were wrong about LoadFromStream. -- Cheers! Rich Saunders

Re: [fpc-pascal] Ping problems - OS/X

2014-05-21 Thread Mattias Gaertner
On Wed, 21 May 2014 21:44:10 +0200 Peter Brooks wrote: > Yes, thank you. The best thing I've learned is to be suspicious of examples... > > I've got it now, thank you all for the assistance. > > I took AStringList.Add() to mean that it added the string to the list > of strings - I was wrong.. >

Re: [fpc-pascal] Ping problems - OS/X

2014-05-21 Thread Peter Brooks
Yes, thank you. The best thing I've learned is to be suspicious of examples... I've got it now, thank you all for the assistance. I took AStringList.Add() to mean that it added the string to the list of strings - I was wrong.. I did note that the example said that it was flawed, but, foolishly,

Re: [fpc-pascal] Ping problems - OS/X

2014-05-21 Thread waldo kitty
On 5/21/2014 7:00 AM, Peter Brooks wrote: AStringList.LoadFromStream(Aprocess.Output); AStringList.LoadFromStream(AProcess.Stderr); AStringList.LoadFromStream(AProcess.Output); [quote] LoadFromStream loads the contents of Stream into the stringlist. Each line in the stream (as marked

Re: [fpc-pascal] Ping problems - OS/X

2014-05-21 Thread Reinier Olislagers
On 21/05/2014 16:36, Peter Brooks wrote: > Unfortunately, I've tried both the full path and just the name - > apparently TProcess is supposed to look in the path - and it does > work. When it is called, it returns a '0' indicating successful > completion. /disclaimer: haven't looked at your code/

Re: [fpc-pascal] Ping problems - OS/X

2014-05-21 Thread Reinier Olislagers
On 21/05/2014 17:02, Reinier Olislagers wrote: > On 21/05/2014 16:36, Peter Brooks wrote: >> Unfortunately, I've tried both the full path and just the name - >> apparently TProcess is supposed to look in the path - and it does >> work. When it is called, it returns a '0' indicating successful >> co

Re: [fpc-pascal] Ping problems - OS/X

2014-05-21 Thread Mark Morgan Lloyd
Peter Brooks wrote: Unfortunately, I've tried both the full path and just the name - apparently TProcess is supposed to look in the path - and it does work. When it is called, it returns a '0' indicating successful completion. I just tried it again with /sbin/ping instead of ping and the behavio

Re: [fpc-pascal] Ping problems - OS/X

2014-05-21 Thread Peter Brooks
Unfortunately, I've tried both the full path and just the name - apparently TProcess is supposed to look in the path - and it does work. When it is called, it returns a '0' indicating successful completion. I just tried it again with /sbin/ping instead of ping and the behaviour is just the same.

Re: [fpc-pascal] Ping problems - OS/X

2014-05-21 Thread Reinier Olislagers
On 21/05/2014 15:01, Paul Breneman wrote: > I've been working with running Linux on an Android tablet (without > rooting the device) and one thing I've seen mentioned is that ping > requires higher priorities (I don't remember the details). You can read > more here: > http://turbocontrol.com/gnu

Re: [fpc-pascal] Ping problems - OS/X

2014-05-21 Thread Paul Breneman
Peter, I've been working with running Linux on an Android tablet (without rooting the device) and one thing I've seen mentioned is that ping requires higher priorities (I don't remember the details). You can read more here: http://turbocontrol.com/gnuroot.htm Best regards, Paul www.TurboC

Re: [fpc-pascal] Ping problems - OS/X

2014-05-21 Thread Mattias Gaertner
On Wed, 21 May 2014 13:00:58 +0200 Peter Brooks wrote: > Sorry, I misled you. I did move it higher up, earlier, to test > something, and I forgot to put it back. > > This version has exactly the same behaviour: > > -rw-r--r-- 1 peterbrooks wheel 0 21 May 13:00 output.txt > > Program nm

Re: [fpc-pascal] Ping problems - OS/X

2014-05-21 Thread Mark Morgan Lloyd
Peter Brooks wrote: Sorry, I misled you. I did move it higher up, earlier, to test something, and I forgot to put it back. This version has exactly the same behaviour: AStringList.LoadFromStream(AProcess.Output); What is this replacing the current content with? -- Mark Morgan Lloyd markM

Re: [fpc-pascal] Ping problems - OS/X

2014-05-21 Thread Peter Brooks
Sorry, I misled you. I did move it higher up, earlier, to test something, and I forgot to put it back. This version has exactly the same behaviour: -rw-r--r-- 1 peterbrooks wheel 0 21 May 13:00 output.txt Program nmp(input,output); uses Classes, SysUtils, Process; var AProcess: TPr

Re: [fpc-pascal] Ping problems - OS/X

2014-05-21 Thread Mattias Gaertner
On Wed, 21 May 2014 11:11:11 +0200 Peter Brooks wrote: > I've got a little program that just pings. It runs. I get a 0 error > return, but there doesn't seem to be any output: > > -rw-r--r-- 1 root wheel 0 21 May 11:09 output.txt > > So it's re-writing the output.txt file, but the > written(

[fpc-pascal] Ping problems - OS/X

2014-05-21 Thread Peter Brooks
I've got a little program that just pings. It runs. I get a 0 error return, but there doesn't seem to be any output: -rw-r--r-- 1 root wheel 0 21 May 11:09 output.txt So it's re-writing the output.txt file, but the written(AstringList.Text) isn't putting anything there. This is almost a dire