All Questions
307
questions
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
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 ...
0
votes
0
answers
85
views
How to execute process with mmap-ed memory as stdin and another mmap-ed memory as stdout?
It is possible in Linux execute process with mmap-ed memory as stdin and another mmap-ed memory as stdout, so parent program can preallocate memory for stdin, write necessary data, execute program and ...
1
vote
0
answers
46
views
Child process using boost::process::child reading some characters from STDIN
Main process is spawning a child process as follows:
bp = boost::process
bp::child(cmd.c_str(), bp::std_out > bp::null, bp::std_err > bp::null, boost::this_process::environment());
where cmd = &...
0
votes
1
answer
55
views
Why isn't my output maintaining integrity after a pipe to a program that takes input from stdin?
My output gets corrupted when I try to pipe some output to another command in the shell. This doesn't happen when I execute the executable alone, or redirect its output to a program that doesn't care.
...
0
votes
0
answers
88
views
(C++) How to have stdout update in real time without affecting stdin
I'm trying to make a simple chat program in the Linux terminal. For simplicity, the "users" are just multiple instances of the terminal on a single machine. However, I don't know how to ...
-2
votes
1
answer
56
views
Why is my stdin redirection not being respected by an execl program?
I have been trying to create a wrapper for a Node.js commandline program in C++. At the moment, I have two threads. One is the main thread, where I will end up doing logic handling, and the other is ...
-2
votes
1
answer
129
views
stdin is not plugged to piped data for /subsystem:windows linked applications
I try to make a GUI application that can tolerate piped data as input, if present.
The use case is either it gets started from file explorer, and it may have a command line argument or not.
Or, it is ...
2
votes
1
answer
151
views
Stop all c++ threads
I have a thread that is calling std::getline(std::cin,input) and another thread that wakes up every x mins and checks a status. If the status is True my whole c++ application needs to terminate/...
1
vote
0
answers
213
views
Is there a more efficient way of reading from stdin and tokenizing than allocating a large buffer and using string_view?
I'm reading a file from stdin and just need to run through it as fast as possible and do some processing on each of the delimited tokens.
#include <iostream>
#include <array>
#include <...
0
votes
0
answers
26
views
How to read data from stdin without waiting for a newline character [duplicate]
I am writing a C++ program in Linux, that reads data from stdin and processes it. Eventually I want to be able to cat a binary file and direct its output to my app. So I need to be able to read ...
0
votes
1
answer
53
views
Problem sending text to stdin of running process
I have a c++ program running with process number PROCNO, and I would like to send text to stdin of this program. However, when I run :
echo test > /proc/PROCNO/fd/0
I see test printed in the ...
0
votes
1
answer
176
views
how to break out of a loop listening on stdin?
I have a while loop in a separate thread listening on stdin, waiting for text coming from another process. When my program is exiting, I would like to exit from this while loop and join the thread.
...
0
votes
2
answers
521
views
Vector passed by reference inside lambda cannot be modified even if mutable keyword is used
I am trying to populate a vector with integer values which are coming in from standard input as follows:
std::vector<int> v;
for_each(v.begin(),v.end(),([&](auto &i) mutable {cin>>...
0
votes
2
answers
161
views
MSVC 2019: Provide input files as text file to the linker
I use MSVC2019 for two C++ projects:
APP is a dynamic link library.
TEST is the automated test project.
TEST does not only perform tests on the API part of the DLL, but also on some non-published ...