The standard output stream (stdout) is the stream where a program writes its output data.
Questions tagged [stdout]
4740 questions
2
votes
1 answer
C# console program - stop STDIN from going to STDOUT
I'm writing a simple console app in C#, .NET 2.0. It starts new threads using a threading timer, while it interprets commands on the main thread.
I currently take three commands:
P - Pause
C - Continue
Q - Quit
This functionality works quite well,…

C. Ross
- 31,137
- 42
- 147
- 238
2
votes
3 answers
check if FILE* is stdout; portable?
I am currently writing a piece of code whose intended usage is this:
program input.txt output.txt
or
program input.txt
in which case it defaults to stdout.
This is the code I have now (within main()):
FILE *outFile;
if (argc < 3) {
outFile…

Riccardo Orlando
- 207
- 2
- 10
2
votes
3 answers
Shell script: Redirect output of program to changing files
My goal:
I would like to redirect the stdout output of my program foo to a changing output file depending on the running time of the program.
The program foo itself is listening on a bsd socket for arriving packets and displays information…

oh.dae.su
- 607
- 6
- 12
2
votes
0 answers
C# Google Or Tools redirect LinearSolver output to string
I have imlemented several models with Google Or Tools LinearSolver.
In the backend it's SCIP, that I'm using
If I'm running my application as a Console App, the output goes directly to the console. I have tried setting Console.SetOut to a custom…

Isitar
- 1,286
- 12
- 29
2
votes
1 answer
How to guarantee the stdout buffer between systemd and journald is flushed when program quits?
The simplified example that demonstrates a problem is
#include
int main(void)
{
printf("foo\n");
fflush(stdout);
getchar();
return 0;
}
(it's not programming language specific though - the original application I…

zerkms
- 249,484
- 69
- 436
- 539
2
votes
0 answers
How to tap on other process' `stderr` and `stdout`?
This question is different from the one proposed as a duplicate:
My question is very specific to .net-core. I.e. even if there is a solution for "classic" .NET Framework it may not be applicable in the .NET Core environment.
There's a significant…

Igor Soloydenko
- 11,067
- 11
- 47
- 90
2
votes
1 answer
Redirecting stdout from a secondary thread (multithreading with a function instead of class?)
I am trying to get my stdout displayed on a QTextEdit made via Qt Designer (PyQt5). Actually I made it work yet it doesn't show the info at the same time it was made. Instead it waits for the process to completely end and only then it shows all the…

shafuq
- 465
- 6
- 20
2
votes
1 answer
Django - Print only errors when running all tests
We're using python - Django 1.10. We have more than 1000 tests. When running all the tests we're getting tons of logs to stdout.
It mainly hurts on deployments - we're creating a docker instance and run all our tests (with python manage.py test).
I…

user2880391
- 2,683
- 7
- 38
- 77
2
votes
0 answers
Why is my stdout not streaming in real time using zeroturnaround redirectOutput
I'm using the zeroturnaround zt-exec library (https://github.com/zeroturnaround/zt-exec), and I can't figure out why the output lines are not processed as they come in. It will wait until the script is done before spitting them all out at once. Is…

LtDan33
- 301
- 3
- 11
2
votes
1 answer
Invoking a script whenever ip monitor writes into stdout
I would like to run ip monitor in the background and invoke a script whenever a new block of output is sent to stdout by ip monitor (or, ideally, if there are several new blocks sent within say 3 seconds, only invoke the script once)
I would like to…

maddingl
- 197
- 4
- 20
2
votes
0 answers
Capture Live stdout of Weird Processes (e.g.: 7za.exe, PsExec.exe)
I've managed to capture the live stdout (and stderr) of many command line tools in a few programming languages, but there are a few tools that I can't get to work.
The tools are:
7za.exe (part of 7-Zip)
PsExec.exe (part of Sysinternals)
The code…

Robert Fey
- 1,747
- 22
- 23
2
votes
2 answers
stdout always cuts off the stream at character 8192
I am using spawn module and executing curl command and getting JSON response from server. This is my code -
var spawn = require('child_process').spawn;
log.debug("Executing curl command for getting all artifacts");
var artifacts_data = spawn('bash…

iSmita
- 1,292
- 1
- 9
- 24
2
votes
1 answer
How to asynchronously log stdout/stderr in Python?
I have a function (which I cannot change) and it prints data to stdout/stderr. I need to log the output of this function. My first idea was to replace sys.stdout with a buffer in the form of StringIO() and then process its contents. That worked…

rubick
- 508
- 1
- 5
- 13
2
votes
1 answer
Redirecting Loggers`messages to sys.stdout and sys.stderr
I´m just starting to learn Python and have encountered a Problem that I´m not able to solve.
I want to redirect every level above CRITICAL to sys.stderr and everything above WARNING to sys.stdout.
I came up with this script...
import…

tweak-wtf
- 63
- 1
- 12
2
votes
1 answer
How to redirect output to file and STDOUT and exit on error
I can exit a program on error like so
ls /fake/folder || exit 1
I can redirect the output to a file and STDOUT like so
ls /usr/bin | tee foo.txt
But I can't do
ls /fake/folder | tee foo.txt || exit 1
because I get the output of tee and not ls
How…

puk
- 16,318
- 29
- 119
- 199