0
6
Fork 0

Implementation exec-alike function #30

Offen
2018-07-29 13:57:36 +02:00 von likoski geöffnet · 5 Kommentare
Besitzer

Aer misses some kind of exec() or system(). It might be very useful, especially on embedded devices to interact with system and other software. I think we should implements it before 1.0.

Aer misses some kind of exec() or system(). It might be very useful, especially on embedded devices to interact with system and other software. I think we should implements it before 1.0.
likoski hat die Labels
enhancement
idea
2018-07-29 13:57:36 +02:00 hinzugefügt
Besitzer

Generally speaking, I think this is good idea.

int exec(string $cmd, [string &$output]);

First argument contains command to execute, second parameter will contains output from command execution if passed by reference.

Function returns -1 if any error ocurred, or command return value.

Some other ideas?

Generally speaking, I think this is good idea. int exec(string $cmd, [string &$output]); First argument contains command to execute, second parameter will contains output from command execution if passed by reference. Function returns -1 if any error ocurred, or command return value. Some other ideas?
Mitglied

Should we get also a potential error reason ? (like from errno for example)

Should we get also a potential error reason ? (like from errno for example)
Besitzer

What kind of error do we expect? If application launched throw error it should be saved in $output and its return code should be returned by exec() function. Do we need something more?

What kind of error do we expect? If application launched throw error it should be saved in $output and its return code should be returned by exec() function. Do we need something more?
Mitglied

All exec* sets errno internally, was just wondering if we should return the string error as third parameter (optional).

Not forcing anything here, it is good as is too.

All exec* sets errno internally, was just wondering if we should return the string error as third parameter (optional). Not forcing anything here, it is good as is too.
Besitzer

This is true. I just wonder in which case it could be useful, because actually I don't find a reason why it might fail, except when exec() would be disabled.

This is true. I just wonder in which case it could be useful, because actually I don't find a reason why it might fail, except when exec() would be disabled.
Anmelden, um an der Diskussion teilzunehmen.
Kein Meilenstein
Niemand zuständig
3 Beteiligte
Nachrichten
Fällig am
Das Fälligkeitsdatum ist ungültig oder außerhalb des zulässigen Bereichs. Bitte verwende das Format „jjjj-mm-tt“.

Kein Fälligkeitsdatum gesetzt.

Abhängigkeiten

Keine Abhängigkeiten gesetzt.

Referenz: aerscript/Aer#30
Keine Beschreibung angegeben.