Questions tagged [stdin]
Standard input (stdin, file descriptor 0) is the input stream to a program.
stdin
3,917
questions
0
votes
0
answers
49
views
How can I get this STDIN to work in GAS Assembler running on Linux?
I am new to Assembler and am currently reading a book about it by Jonathan Bartlett called 'Learn to Program with Assembly'. On pages 160-1 he gives the following sample program to demonstrate the use ...
0
votes
0
answers
36
views
asio::stream_descriptor for async read from stdin in raw mode crashes
I want to poll stdin asynchronously for terminal keyboard events, hence the following
/* class tui contains a member 'stdin_' of type 'asio::stream_descriptor',
initialized as such : stdin_{...
0
votes
0
answers
17
views
Send SSH input when output string is detected on windows from python
My company requires a passcode when SSHing to a server:
ssh myserver
Enter a passcode or select one of the following options:
Passcode:
I want call SSH in the background from a GUI so want to detect ...
5
votes
7
answers
268
views
gawk hangs when using a regex for RS combined with reading a continuous stream from stdin
I'm streaming data using netcat and piping the output to gawk. Here is an example byte sequence that gawk will receive:
=AAAA;=BBBB;;CCCC==DDDD;
The data includes nearly any arbitrary characters, but ...
0
votes
1
answer
21
views
undetectable Dart-Input in Visual Code Studio
I made a script in in Visual Studio Code using Dart that grabs the user's input.
The problem is, that if I enter something in the input line in vscode, which is located below the debug console and ...
0
votes
0
answers
53
views
Break the loop if stdin has value
I can not stop the loop if there is not a gap in data send via UART.
If there is gap in data it listens to the command but does not read the UART data anymore.
I would like to
I read data on UART and ...
1
vote
1
answer
51
views
How do I read all keys pressed in nim since the last call to a function, without needing to press enter
I need to read keys from stdin without blocking, and without only recieving them when a newline is pressed. The way i would like it be formatted is a sequence, where each item is a keypress or ascii ...
0
votes
0
answers
36
views
How do I know when a program is waiting for an input and then give the input through Python?
Sorry, this might look very stupid but I have a console C++ program and I need to pass input through Python. It is unexpected when this C++ program waits for an input and so I hoped I could have done ...
-1
votes
1
answer
47
views
Wrapping os.Stdin with an io.TeeReader breaks the tty
Context: I am trying to write a small tool in Golang, which spawns a vim editor and tries to record all the keystrokes input by the user.
package main
import (
"bufio"
"fmt&...
0
votes
0
answers
11
views
Console screen import/export error when using freopen
Can anyone tell me that when using freopen, sometimes when I call new functions using input and output commands on the console screen, it doesn't work? When running, it still works and still processes ...
0
votes
0
answers
23
views
Removing [stdin] keypress listener (or going around) from 3rd party app within plugin/extension (Vitest in this case)
I am writing Vitest reporter, when running tests in watch mode there is an active listener on keypress event on stdin. I want to have my own handling of user interaction, and this one pretty ...
0
votes
0
answers
18
views
Building a menu with inputs from serial port on a Pi Pico
After getting the first input, is not following the normal logic to continue waiting for the input and directly return an error.
1.Checking if there is any data on the stdin with readline() function ...
1
vote
1
answer
67
views
How can I read from neovim's stdin, using rust?
I'm pretty new to rust and I thought I could get some help here.
I'm trying to follow a guide about making LSPs from TJ DeVries, he is coding it in Go but I'm trying to follow along in Rust. I'm stuck ...
0
votes
1
answer
51
views
Bash - Log timestamp of the moment data was received on stdin, coming from a pipe
I have an application that outputs to stdout from time to time - random intervals, random durations of outputting before going silent again. Its output (binary data) is captured into a file.
I want to ...
0
votes
0
answers
58
views
Redirect sendNativeMessage sent to batch file
I am trying a test addon on mozilla that uses sendNativeMessage().
This addon sends a "ping" string to a .bat file.
I am trying to get the input and redirect it to a file.txt.
Sadly, all i ...
0
votes
0
answers
44
views
getline() in C is not receiving input
I am trying to build a simple shell and im having a huge problem with receiving input from the stdin.
For whatever reason when i call getline(), the program gets stuck there and it can't progress.
...
-1
votes
1
answer
73
views
C# code, SendKeys.Send gets "Access denied..." error occasionally [duplicate]
I have a C# code, in which I need to run a very old vendor binary to ASCII conversion program, here is relevant part of my code:
C# code with SendKeys.Send "Access denied..."
These codes are ...
0
votes
1
answer
42
views
How to properly escape/quote the output so it's treated as an escaped input? [duplicate]
I've been trying to create a set of aliases or functions, that I can use in conjunction with file operating commands.
The idea is to have 1, 2, 3 functions/aliases that will return latest, second-to-...
0
votes
0
answers
35
views
Read a single char value to stdin without pressing enter on keybard in C in mac os [duplicate]
I am using mac os with xcode-select version 2406
I am trying to find a way to Read a char value to STDIN without pressing enter or return key on keyboard in C.
I know on windows we have getch function ...
1
vote
1
answer
62
views
Piping input into running Python script
Maybe this is the wrong approach, so feel free to redirect.
I am trying to asynchronously pipe input into a python script. The idea is that I have a background Python script do some long initial setup ...
3
votes
1
answer
202
views
Reading and Writing more than 4096 bytes to and from STDIN [closed]
I'm trying to implement a here document like the one used in bash (in C), but I noticed that I can't give it a line that's longer than 4096 bytes, I looked it up and It was because of the max size of ...
0
votes
0
answers
30
views
How to read piped input and use Console.ReadLine() in the same C# program?
I am trying to create a program that must accept piped input, and be able to request more input from the user afterwards. The problem is that after I read the piped input, I can no longer use Console....
2
votes
0
answers
38
views
Writes to child subprocess.Popen.stdin don't work from within process group?
From within a Python script, I'm launching an executable in a subprocess (for anyone interested: it's the terraria server).
# script.py
server_process = subprocess.Popen("my_executable arg1 arg2&...
4
votes
2
answers
382
views
How can I read a single line user input with Bun.js?
Bun.js has a useful native API to read periodical user input:
const prompt = "Type something: ";
process.stdout.write(prompt);
for await (const line of console) {
console.log(`You typed: ${...
1
vote
1
answer
96
views
Communicating Java and Python processes freeze after a while when using readline() but not input()
I have a Java program that needs to process a long series of input strings. To do this it goes through each string, passes it to a Process (a Python script), gets the result from the Process's ...
0
votes
1
answer
49
views
Redirecting stdout with execvp
This code basically a small part of the binary tree with nodes being processes, and it should traverse the tree inorder way passing num1 to left subtree etc. This one just creates a left child and ...
0
votes
0
answers
64
views
tar extract zip archive from file or STDIN - discrepancy
Training to download and extract archive (zip archive, created by 7z) by
curl --output - "https://host.com/archive.zip" | tar -f - -C %dest_dir%
but archive extract is incomplete. Some ...
0
votes
2
answers
156
views
Why is STDIN open by default for programs running in SystemD?
I have an if-statement at the top of a C main method, which checks if STDIN is open. If it is open, the program prints an error and exits. This is mainly for documentation reasons. I don't want ...
0
votes
0
answers
66
views
Is it possible to listen for console input from a C# Windows Application?
I have a .NET Core 3.0 Windows application that was interfacing with Chrome native-messaging stdin, however after .NET 8 migration, the application no longer has console stdin access. (Note: it was ...
0
votes
1
answer
49
views
Executing sed via execvp makes other pipes blocked
I am playing around with fork/pipe/dup/execvp concepts and came out with a little problem:
I made a test main to execute sort and manually send some numbers via pipe bound to STDIN and it works as ...