Am 02.07.2016 07:55 schrieb "Bo Berglund" <bo.bergl...@gmail.com>:
>
> On Sat, 02 Jul 2016 01:12:34 +0200, Bo Berglund
> <bo.bergl...@gmail.com> wrote:
>
> >The commands I am looking at now are:
> >sudo ifup wlan0
> >sudo ifdown wlan0
> >
> >How could this be accomplished in a FreePascal program running as user
> >Pi?
>
> To be specific I would like to know how I can send any command to the
> Linux operating system from my FreePascal program?
>
> Just doing this seems not to cut it:
>
> writeln('sudo ifup wlan0');
>
> This just *displays* the text on the program console, but I want it to
> go to the operating system as a command...
>
> On Windows one has to start cmd with the wanted command as a
> parameter, what is the corresponding method on Linux from within
> FreePascal?

Either fpsystem() from unit BaseUnix (this is the FPC variant of the C
system() call) or TProcess if you should need to provide password input on
a GUI.

Regards,
Sven
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to