Add stdmsg (an alias to either stdout or stderr).
This commit is contained in:
parent
20c69dac9e
commit
db73f3af20
1 changed files with 7 additions and 9 deletions
|
|
@ -1947,15 +1947,13 @@ when not defined(JS): #and not defined(NimrodVM):
|
||||||
## The standard output stream.
|
## The standard output stream.
|
||||||
stderr* {.importc: "stderr", header: "<stdio.h>".}: TFile
|
stderr* {.importc: "stderr", header: "<stdio.h>".}: TFile
|
||||||
## The standard error stream.
|
## The standard error stream.
|
||||||
##
|
|
||||||
## Note: In my opinion, this should not be used -- the concept of a
|
when defined(useStdoutAsStdmsg):
|
||||||
## separate error stream is a design flaw of UNIX. A separate *message
|
template stdmsg*: TFile = stdout
|
||||||
## stream* is a good idea, but since it is named ``stderr`` there are few
|
else:
|
||||||
## programs out there that distinguish properly between ``stdout`` and
|
template stdmsg*: TFile = stderr
|
||||||
## ``stderr``. So, that's what you get if you don't name your variables
|
## Template which expands to either stdout or stderr depending on
|
||||||
## appropriately. It also annoys people if redirection
|
## `useStdoutAsStdmsg` compile-time switch.
|
||||||
## via ``>output.txt`` does not work because the program writes
|
|
||||||
## to ``stderr``.
|
|
||||||
|
|
||||||
proc Open*(f: var TFile, filename: string,
|
proc Open*(f: var TFile, filename: string,
|
||||||
mode: TFileMode = fmRead, bufSize: int = -1): Bool {.tags: [].}
|
mode: TFileMode = fmRead, bufSize: int = -1): Bool {.tags: [].}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue