Line 39... |
Line 39... |
39 |
a command. Instead, it opens the batch file, jumps to the "next line to be
|
39 |
a command. Instead, it opens the batch file, jumps to the "next line to be
|
40 |
executed" and loads the command from there, incrementing the line counter in
|
40 |
executed" and loads the command from there, incrementing the line counter in
|
41 |
the process.
|
41 |
the process.
|
42 |
|
42 |
|
43 |
|
43 |
|
- |
|
44 |
=== PIPING COMMANDS ==========================================================
|
- |
|
45 |
|
- |
|
46 |
Piping a command means redirecting its standard output (stdout) to the
|
- |
|
47 |
standard input (stdin) of another command. While redirection of file handles
|
- |
|
48 |
is a concept well supported by the DOS kernels, piping is not, in part due to
|
- |
|
49 |
the mono-task nature of DOS. SvarCOM provides piping support through following
|
- |
|
50 |
logic:
|
- |
|
51 |
1. user-entered (or batch-acquired) command line is analyzed for any kind of
|
- |
|
52 |
redirections (incl. pipes) by redir_parsecmd(). If the command appears to
|
- |
|
53 |
be piped, then redir_parsecmd() enforces a stdout redirection to a
|
- |
|
54 |
temporary file and moves all the pipe chain to an RMOD-owned buffer named
|
- |
|
55 |
"awaitingcmd", appending an stdin redirection so the next command's stdin
|
- |
|
56 |
is fed from the temporary file. The command is then executed.
|
- |
|
57 |
2. before further execution, SvarCOM looks into its "awaitingcmd" buffer, and
|
- |
|
58 |
if it is non-empty, it runs its content.
|
- |
|
59 |
3. when loading commands from the awaitingcmd, SvarCOM sets a special
|
- |
|
60 |
"delete_stdin_file" flag and passes it to command-executing functions so
|
- |
|
61 |
these remember to delete the stdin-redirected file.
|
- |
|
62 |
|
- |
|
63 |
|
44 |
=== GLOBAL EXECUTABLE LINKS ==================================================
|
64 |
=== GLOBAL EXECUTABLE LINKS ==================================================
|
45 |
|
65 |
|
46 |
SvarCOM features special support for "global executable links". This allows to
|
66 |
SvarCOM features special support for "global executable links". This allows to
|
47 |
run selected programs from any directory, without the need to copy these
|
67 |
run selected programs from any directory, without the need to copy these
|
48 |
programs to a directory in %PATH%. Executable links are flat files written in
|
68 |
programs to a directory in %PATH%. Executable links are flat files written in
|