Типы
Переменные
Процедуры
Returns TRUE if the process has finished. In this case puts in err
the exit code of the process.
Reads at most limit
1-byte characters (bytes) from the standard output pipe of the started process to buf
, puts in len
the number of 1-byte characters read. Does not add 0X in the end of buf
.
The process must first have been started with StartProcess or StartProcessIn.
Starts a process with the given path cmd
to the executable, waits for it to finish and puts its output (as bytes, converted to 1-byte-wide SHORTCHARs) to buf
, using at most len
space. Puts in err
the exit code of the finished process. Does not add 0X in the end of buf
.
Returns 1 on success, 0 on failure.
Starts a process with the given path cmd
to the executable in the directory dir
, waits for it to finish and puts its output (as bytes, converted to 1-byte-wide SHORTCHARs) to buf
, using at most len
space. Puts in err
the exit code of the finished process. Does not add 0X in the end of buf
.
Returns 1 on success, 0 on failure.
On Unix/Linux dir
is ignored.
Puts in result
the full path to the executable filename
if it is found in the PATH environment variable. Uses SearchPath WINAPI call on Windows. Returns 1 on success, 0 on failure.
On Unix/Linux just copies filename to result and returns 1.
Starts a process with the given path to the executable. Returns TRUE process has been started successfully.
Starts a process with the path cmd
to the executable, but starts it from a directory dir
. Returns TRUE on success.
Writes len
1-byte characters (bytes) from buf
to the standard input pipe of the started process.
The process must first have been started with StartProcess or StartProcessIn.
Crossplatform Pipe Support
This tiny library is created for crossplatform pipe support. It is needed by the virtual terminal of Free Oberon. When a program is being run in the IDE, Free Oberon creates a child process and attaches a pipe to its stdin and stdout. This way a program may run both in real terminal and inside Free Oberon IDE, which itself acts as a terminal emulator.
When you run
./make.sh
ormake.bat
in directorysrc
, one of the two files is automatically selected for compilation:term_win32.c
orterm_linux.c
:-
term_linux.c
is a GNU/Linux version (tested on Debian, Ubuntu, Mint), it uses fork, dup2, execl, fcntl and waitpid.-
term_win32.c
is a Windows version, it uses WinAPI (CreateNamedPipeA and other functions).Term.Mod is an Oberon binding for this library, the binding is used as a cross-platform module.