10,351 questions
49
votes
9
answers
44k
views
C# Console receive input with pipe
I know how to program Console application with parameters, example : myProgram.exe param1 param2.
My question is, how can I make my program works with |, example : echo "word" | myProgram.exe?
1
vote
1
answer
2k
views
I created a pseudoconsole, wrote something to one end of it, but nothing comes out of the other. Why?
I am trying to make a pty pipe. For that I have to use the CreatePseudoConsole function from the Windows api. I am loosely copying this which is this but in python.
I don't know if it's relevant but I ...
0
votes
1
answer
68
views
Named pipe is inaccessible while open from writer
I am trying to use the lauterbach application
The application has a built in command AREA.PIPE which pipes everything from the log window to a file
However, when I create a python script to read from ...
4
votes
1
answer
106
views
Understanding usage of withFileBlocking with named pipes
The following program
assumes that /path/to/mypipe is a named pipe, e.g. created via mkfifo /path/to/mypipe, with no readers/writers waiting yet,
runs two threads, of which
the main thread keeps ...
1
vote
2
answers
3k
views
Can I lock and unlock a fifo (named pipe) in C?
I have two processes, p1 and p2, and a named pipe var for ipc between 2 processes.
I want to lock var's rw for p2 when p1 writes, and unlock var when p1 finished write.
ps:
I am using select for ...
0
votes
1
answer
9k
views
dup2 bad file descriptor
I am trying to implement pipe to my shell. Right now it can handle normal commands like ls, who, date etc..
By reading a lot and going in to other stack overflow posts to check how pipe is supposed ...
18
votes
7
answers
2k
views
How can I pipe the columns of a dataframe directly into a function?
This code makes a sentence from two different columns in a data frame
library(dplyr); library(tibble); library(magrittr)
mtcars %>%
rownames_to_column(var = "car") %>%
sample_n(5)...
3
votes
0
answers
56
views
in windows/C# how to open pipe and get an IOChannel from them?
I'd like to build a fake Gimp host in C# to query/run windows gimp plug-in.
For reference, at the end of this message, you'll find what I understood of the protocol to talk to a Gimp plug-in.
To do ...
10
votes
2
answers
10k
views
How to redirect stderr from inside the process in Rust?
I'm attempting redirect the Stderr file descriptor from inside the process, but there seems to be no implementations of it, and I don't see a clear route to anything similar to dup2 from C/C++.
I've ...
28
votes
10
answers
8k
views
Is there a command-line shortcut for ">/dev/null 2>&1"
It's really annoying to type this whenever I don't want to see a program's output. I'd love to know if there is a shorter way to write:
$ program >/dev/null 2>&1
Generic shell is the best, ...
3
votes
1
answer
11k
views
Netcat with named pipe
I have a client that connects to a server on localhost:10000. The server is not in the same host. But we can not access to the server from IP network. For this we are writing our own network driver ...
0
votes
2
answers
177
views
Scanf not reading piped input's first value only as expected (reads as string, expected integer)
We are printing Linux device events in one program than trying to read and interpret the data by piping the input of that program into another.
First program's relevant code:
struct input_event event1;...
0
votes
1
answer
168
views
How to write data to a specific fd using Python Pwntools
I'm trying to use pwntools's process and to write a string to a specific fd
In the documentation, there is a parameter to process of stdin and stdout but I do not understand how to use it correctly.
I ...
1
vote
1
answer
450
views
Redirect all output of stopped and resumed command to file or block device
How do I redirect the output of a process run in bash (4.2.45(1)-release (x86_64-pc-linux-gnu)) stopped with SIGSTOP (usually sent with Ctrl+Z on Debian based and possibly other systems) and resumed ...
86
votes
7
answers
145k
views
Example of using named pipes in Linux shell (Bash)
Can someone post a simple example of using named pipes in Bash on Linux?
130
votes
9
answers
185k
views
How can I get a list of all open named pipes in Windows?
Is there an easy way to test whether your named pipe is working correctly? I want to make sure that the data I'm sending from my app is actually being sent. Is there a quick and easy way to get a list ...
0
votes
5
answers
149
views
Handling of quitting the pipe / stdin on linux when no input received
Say I have an image viewer program. I would want to view images in these two ways:
imageviewer [list of files] // scenario A
[list of files] | imageviewer // scenario B
and using one method shall not ...
2
votes
2
answers
93
views
Does setvbuf(_IONBF) disable pipe blocking?
An MRE will be tricky here because this relies on (a very simple) secondary terminal executable, but I'll try my best:
Windows 11, WoW64 (32-bit compatibility) executable mode
c99
An MSVC-like (but ...
4
votes
1
answer
102
views
How to return variables from a curly brackets scoped code?
How do I return variables from curly braces?
For example, how do I get the return value of the command curl outside the curly brackets in the following snippet?
#!/usr/bin/bash
{ # scope for tee
...
8
votes
4
answers
8k
views
How to unblock ConnectNamedPipe and ReadFile? [C#]
I have a class (NamedPipeManager) which has a thread (PipeThread) that waits for a NamedPipe connection using (ConnectNamedPipe) and then reads (ReadFile) - these are blocking calls (not-overlapped) - ...
-1
votes
1
answer
68
views
Using which() function in pipe to access dataframe column [closed]
I've seen the question How to use the which() function with a pipe %>% but it doesn't encapsulate the problem I am having. I would like to access the column names of a dataframe inside the which() ...
258
votes
3
answers
170k
views
Piping both stdout and stderr in bash?
It seems that newer versions of bash have the &> operator, which (if I understand correctly) redirects both stdout and stderr to a file (or &>> appends to the file).
What's the ...
0
votes
1
answer
1k
views
How to find file and print the content of the file by using find and cat (is it possible?)
so I am fairly new at working with Linux and i was wondering if there is any way to use find commando to find a file in a location then pipeline it to print out (with cat commando) the content of that ...
12
votes
1
answer
9k
views
Writing a video frame by frame using ffmpeg
I am trying to write a video frame-by-frame using ffmpeg as explained here: http://zulko.github.io/blog/2013/09/27/read-and-write-video-frames-in-python-using-ffmpeg/
However, I am always getting an ...
6
votes
1
answer
176
views
How to correctly parse system call execution times from strace output using pipes in C?
I'm working on an operating system programming assignment to understand pipes. M3.md The task involves using regular expressions to extract information from strace output and statistic system call ...