Questions tagged [unbuffered-output]

12 questions
28
votes
3 answers

Detecting when a child process is waiting for input

I'm writing a Python program for running user-uploaded arbitrary (and thus, at the worst case, unsafe, erroneous and crashing) code on a Linux server. The security questions aside, my objective is to determine, if the code (that might be in any…
miikkas
  • 818
  • 1
  • 8
  • 25
25
votes
6 answers

bash: force exec'd process to have unbuffered stdout

I've got a script like: #!/bin/bash exec /usr/bin/some_binary > /tmp/my.log 2>&1 Problem is that some_binary sends all of its logging to stdout, and buffering makes it so that I only see output in chunks of a few lines. This is annoying when…
bstpierre
  • 30,042
  • 15
  • 70
  • 103
22
votes
8 answers

Oracle PL/SQL - tips for immediate output / console printing

I have a number of pl/sql procedures that can take several minutes to run. While developing them, I've added a few print statements to help debug and also provide some feedback and progress indicators. Initially, I ran these on small test sets and…
12
votes
3 answers

What is the equivalent of unbuffer program on Windows?

Hi according to this post, unbuffer connects to a command via a pseudo-terminal (pty), which makes the system treat it as an interactive process, therefore not using any stdout buffering. I would like to use this function on Windows. May I know what…
userpal
  • 1,483
  • 2
  • 22
  • 38
10
votes
6 answers

Segmentation fault question

I have observed that sometimes in C programs, if we have a printf in code anywhere before a segmentation fault, it does not print. Why is this so?
avd
  • 13,993
  • 32
  • 78
  • 99
4
votes
1 answer

Android: BufferedOutputStream necessary when saving file to internal data?

I wanted to save a string to a file and read it back, so I followed those two examples: developer.android.com example anddev.org example However, in both of them, no BufferedOutputStream wrapper is used, while the docu of FileOutputStream…
jellyfish
  • 7,868
  • 11
  • 37
  • 49
3
votes
1 answer

Perl: Print log at runtime instead of dumping all at once later

I have a Perl script that runs from Jenkins slave. The script executes a shell script kept on remote box A. This shell script actually deploys war on machine A itself. Both machines, Jenkins slave and remote box are CentOS instances. use strict; use…
Technext
  • 7,887
  • 9
  • 48
  • 76
3
votes
2 answers

Buffered versus unbuffered output for Python in Windows

I use NppExec/Notepad++ to run Python scripts, and flush my output buffers continuously during runtime to update my console window with print statements (The default buffered output only shows all print statements after the script finishes…
prrao
  • 2,656
  • 5
  • 34
  • 39
2
votes
1 answer

How to save the tty without a buffer?

I'm having trouble with buffers : I have a daemon D, and its monitor M. D is started before M, and M prints any relevant information to the tty, and I need to parse this information and give it to a program of my own. Since I want to automate this,…
gqq
  • 21
  • 1
1
vote
1 answer

C - write() system call prints gibberish instead of pid_t

The following code: #include #include #include int main() { pid_t mypid = getpid(); write(1, &mypid, sizeof(pid_t)); return 0; } Prints gibberish instead of actual pid. Why?
qiubit
  • 4,708
  • 6
  • 23
  • 37
0
votes
0 answers

unbuffered I/O: read int from file and write it on standard output

This program is meant to take as parameter a file, then read a string from standard input and write its length into the file, then read the content of the file (which is supposed to contain the lengths of the strings from the standard input) and…
Grugnas
  • 35
  • 6
-1
votes
2 answers

How can I achieve unbuffering without Tcl?

I'm a happy user of unbuffer, but am now faced with a system that doesn't have Tcl installed (and I don't have root privileges). Can I achieve the same effect without using Tcl? A scripting solution would be nice, but I would not be averse to even…
einpoklum
  • 118,144
  • 57
  • 340
  • 684