Questions tagged [pipe]

A pipe is an interprocess connection between file descriptors of two processes. A pipe is created with the POSIX pipe() function (from <unistd.h>). Shells create pipes between processes if the "|" symbol is used: "cmd1 | cmd2" directs the output of cmd1 to the input of cmd2. On Windows use CreatePipe(). This mechanism redirects standard input, standard output, and standard error into the calling process in .NET and Java.

Filter by
Sorted by
Tagged with
1 vote
1 answer
31 views

Named Pipes in Linux with Python read/write miss some lines of text

I am learning how to use named pipes to pass data between processes. To test it out, I wrote two Python scripts, which I called pipewriter.py and pipereader.py, and a named pipe called my_pipe (using ...
Paul Wintz's user avatar
  • 2,610
0 votes
1 answer
58 views

Output of popen() is different from execute "sh -c cmdstring"

Description I tested an example of APUE(Advanced Programming in the UNIX Environment, 3ed), 15.3 popen and plcose Function. Example code is as below #include "apue.h" #include <sys/wait.h&...
JiangZiyang's user avatar
0 votes
1 answer
54 views

how to restart consumer process using producer process in pipeline

I have this exactly: set -eo pipefail; while true; do echo '(re)starting server...' ( while read line; do if test "$line" == 'rs'; then echo 'restarting...' > /dev/...
Alexander Mills's user avatar
0 votes
0 answers
32 views

Howto use C++ do pipe run python and capture stdout/stderr output?

We know that python supports running some short statements with the -c command line without creating a .py script file. In addition, python can also be started through the command line pipeline, ...
user23034428's user avatar
2 votes
2 answers
58 views

Golang executed command with Run() is not returning

I am attempting to create a music streaming service using youtube-dl and ffmpeg. When a user sends a POST request with a video URL, my handler code works as shown below: router.POST("/submit&...
H.Okan's user avatar
  • 81
1 vote
1 answer
53 views

avoiding/disabling lazy evaluation for pipeline processing [duplicate]

Imagine I have a set of functions for data processing, for example: procA <- function(input){ cat('\n Now processing #A') # message just to log pipeline flow # Actual data processing, may ...
Vasily A's user avatar
  • 8,442
0 votes
0 answers
14 views

papparse how do I manage errors and retrieve meta information while pipeling?

I am parsing a CSV file using papparse streaming feature import fs from 'node:fs' import papa from "papaparse" const reader = fs.createReadStream(csvPath) .pipe(something)...
tit's user avatar
  • 609
0 votes
0 answers
21 views

Which pipes do I need to close per process in a Unix pipeline with multiple pipes?

In my answer to this SO question, I decided to implement the pipeline git log --format='%an' | sort | uniq -c | sort -nr | head -n 3 I'm pasting it here for reference: #include <stdio.h> #...
uzluisf's user avatar
  • 2,653
0 votes
0 answers
75 views

using pipe between for loop's iterations

#include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <string.h> #include <sys/wait.h> #include <sys/types.h> #include <fcntl.h> #define MAXLEN ...
Gamja's user avatar
  • 13
0 votes
1 answer
31 views

How to make named pipes in bash take both command line args and user input and output them into another program?

I am currently learning how named pipes work in bash. I want to create two programs; one that takes in an argument (e.g a name) from the user and another that takes input as the code is ran (using ...
Jake O Grady's user avatar
0 votes
0 answers
46 views

issue with dup2() and pipe(): using same pipe as stdin and stdout

(this is my first time using stack overflow, so i may have some issues writing) I am trying to make linux pipe system in c by pipe() and dup2(). i was thinking to redirect stdout of the previous ...
Gamja's user avatar
  • 13
0 votes
2 answers
173 views

How do you register custom pipes in Angular 17?

I just created a custom Pipe and normally I would register it in app.module.ts, but In Angular 17 we dont have that file. How do we register now? TIA I was thinking of importing into the imports array ...
Hugh's user avatar
  • 19
1 vote
3 answers
58 views

Convert utc date time to local in angular

I'm getting this date time format Sat Nov 18 2023 22:30:00 GMT+0530 (India Standard Time) this.selectedDate = info.date; i want to convert this date time into local date time object but the format ...
user3653474's user avatar
  • 3,493
0 votes
1 answer
38 views

Sum calculated from parent process and child process using fork() not correct in C

I was hoping to get some help about the following issue. So, in the child process I get a value of 7 which is confirmed the printf statement after the for loop. The issue however is that after writing ...
Ssq Dd's user avatar
  • 1
0 votes
2 answers
74 views

Is there a base pipe way of using the unique value of a column to pipe into labs from ggplot

The problem is fairly simple - if I take a df and perform a few filtering steps on it, I'd like to be able to pipe the output of those into a ggplot function and use the unique value of a particular ...
biomiha's user avatar
  • 1,382
0 votes
0 answers
24 views

R incorporate for loop into pipe to calculate percentile rank across many cols

dfW %>% group_by(Grade,year) %>% mutate(pctRank.x = rank(x)/length(x)) I use the above code to calculate percentile rank as grouped by grade and year. Instead of just apply this to a col ...
yzhao's user avatar
  • 31
1 vote
1 answer
100 views

After Angular upgrade to 16 - error NG8004: No pipe found with name 'txtTranslate'

I have updated my Angular app from Angular 15 to 16. I got few compilation errors with few node packages and i resolved them. Even after that getting many errors as below as ng serve error NG8004: No ...
Priya Ganesan's user avatar
0 votes
0 answers
10 views

C - possible reordering issue with pipe access and mutex

I have 2 threads running after write_fd was initialized by a call to pipe(): static bool finished = false; Thread 1 pthread_mutex_lock(&lock); if (!finished) { write(write_fd, buf, buf_len); }...
Itay Bianco's user avatar
1 vote
1 answer
36 views

Is there a way to stop `View` from the native pipe from producing new tabs in RStudio?

I've adapted to using the new native pipe in R and RStudio. However when I pipe directly into View it creates a unique new tab which has been cluttering up my window. Is there anyway to restrict the ...
John-Henry's user avatar
  • 1,670
0 votes
0 answers
40 views

GNUplot nothing is plotting

I'm trying to represent the diffusion of temperature on an aluminum plate over time. I'm using GNUplot to show the result on the form of a heatmap. The problem is that, I would like for the graph to ...
Noah Dbc's user avatar
0 votes
0 answers
42 views

Mini Shell in C implementation of pipeline : wait for child process problem

I've been trying to implement the pipeline functionality in a mini shell that I am building using C. However I noticed that when the pipeline contains processes that needs to wait other process and ...
Jix's user avatar
  • 11
2 votes
3 answers
225 views

How can I use async pipe with @defer to load and declare variable in template in Angular 17

For Example using @if, I am able to do this: @if(items$ | async; as items). I am able to declare 'items' as a variable holding the array of items using the 'as' keyword in the template. How can I ...
imalphachild's user avatar
0 votes
1 answer
45 views

Avoiding core dump in cJSON parse endless loop while replacing nested values

I have a cJSON tree in which I am saving the x and y values of a cosine I am generating in a while loop. It looks like this: "myXY": [{ "x": 2.0110001564025879, &...
couscous's user avatar
0 votes
0 answers
40 views

Three processes using Pipes is not running third process

I am working on a project for a computer architecture class, and I can't figure out why the third process in my C code is not running. I was given a skeleton code by the TA, and I went to an extra ...
Samantha Garcia's user avatar
0 votes
0 answers
26 views

From Python, piping images to FFMPEG process with audio input, "-shortest" flag causes output file to contain only 1 frame of video and entire audio

From Python, I run FFMPEG and write images to its stdin via pipe, the FFMPEG process has an audio file as input too. Everything works fine like this: cmd = ['ffmpeg', '-hide_banner', '-y', '-loglevel',...
b_yang's user avatar
  • 109
2 votes
0 answers
72 views

Freeze when writing ffmpeg execution result to io.Pipe

I am writing a wrapper to work with exec.Cmd to work with io.Pipe. The wrapper is intended to simplify work with the file system, I want to convert a video, write the result of the conversion to io....
alex's user avatar
  • 574
1 vote
0 answers
30 views

Why is the code not writting the correct data into the output file XV6

I am trying to make a function which takes in 3 operations(such as ls, cat, echo) and write the result to the output file. I have created the function which creates 3 new char arrays and store the ...
Shubham Bajaj's user avatar
0 votes
1 answer
44 views

How to create an external command whose output is structured?

How do I write a command in another programming (e.g. JavaScript, C) that produces structured data output much like scripts written in the nu language? I read the documentation to find out that ...
Artem Ilyumzhinov's user avatar
0 votes
0 answers
12 views

Error when using pipe operator and grep in subprocess.check_output to list out Kubernetes pod names [duplicate]

Currently using Kubernetes in a project of mine and am trying to use a Python script to fetch the pod names. For example, let's say my pod names begin with frontend, backend, queue, and service. The ...
andrew g's user avatar
2 votes
1 answer
53 views

expressJS pipe video from GCS

I am sure this question has been asked a million times, but I am having issues with the following script. It works fine in Safari browsers but not Firefox or Chrome. app.get('/stream', async (req, res)...
Russell Harrower's user avatar
0 votes
0 answers
33 views

Broken Pipe in Infinite Loop

server.py: import socket serverSocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) host = '' port = 50000 serverSocket.bind((host, port)) #===================================================...
ProgramV's user avatar
0 votes
1 answer
43 views

Piping cat output into a Java jar through the terminal

I have a JAR file that will require use of the standard input. I need to use this command and cannot change it: cat filename | java -jar jarname.jar I want this to be accessible to the JAR somehow, ...
Jack Sack's user avatar
0 votes
2 answers
51 views

Unable to execute command prompt command from python

Unable to execute a ffmpeg command directly from python, however it works fine if used within the command prompt. os.system("cmd /c ffmpeg -i video.mp4 -i sound.mp3 -c:v copy -filter_complex '[1:...
StudentProgrammer's user avatar
1 vote
0 answers
31 views

Using my TUI tool in a subshell or pipe "steals" the stdout. How can I delay a write to a pipe so that my TUI can use the terminal first?

I'm writing a simple TUI in Go from scratch, it puts the terminal into Raw mode (non-canonical mode) and turns off echoing, then it interprets user input, draws a TUI and shows an image based on that ...
sweet's user avatar
  • 25
0 votes
1 answer
97 views

How to use Command Prompt commands from a Java application

I'm trying to create a java program that runs CMD with a specific command dir C:\windows | java -jar C:\\Column.jar 3 When i run it manual works, but I've not been hable to run it from java. I have ...
Austrecliciano's user avatar
0 votes
1 answer
54 views

Execute python file in cpp

I want to execute a python file in cpp, to make it a process that can communicate with my other child process. But when I use execl("python3", "python3", "python/a1.py"); ...
Brian's user avatar
  • 11
3 votes
1 answer
30 views

How do I pass the output of a program to my build when running from CLION?

I want to launch a program like this: tar -xOzf ../data/schifo.tar.gz schifo.tsv | ./myexe but directly from CLion, how can I do that? I'd rather not decompress the whole file btw In the "Edit ...
desperate's user avatar
2 votes
1 answer
45 views

Linux/C: Process with a child both hangs after adding waitpid

Consider the following piece of code, which does: Fork a child, creating a pipe. The child will redirect the standard input to the pipe, and then read from the standard input (aka from the pipe). The ...
ABu's user avatar
  • 10.7k
1 vote
1 answer
82 views

How piping mechanism works in UNIX

I would like to confirm my understanding about piping in UNIX command execution. When we use pipe in a sequence of commands, the output of preceding command is passed as input to the following command....
user3103957's user avatar
1 vote
2 answers
81 views

How can I send an error over a pipe in C?

I have a multi-threaded C program, and I create a pipe to send data between theads. I have one thread that generates the data and writes it to the pipe, and then another thread that reads data from ...
wile_e8's user avatar
  • 347
0 votes
1 answer
50 views

`moment` library vs angular `Pipe` in handling Date formatting

I am using both moment library and angular pipe to handle Date object (formatting). The problem I have found is the difference in interpretation of the date format string. I have java script Date ...
janci's user avatar
  • 233
0 votes
1 answer
103 views

Rock, Paper and Scissors on C, using fork() and pipe()

I have an exercise for class, this is the exercise: Practice 2. Write a class called "Game" on C++ that does the following: Create a child process responsible for randomly returning "...
HenrickT's user avatar
2 votes
2 answers
53 views

How make long-term pipe connection between go and c# console application

I have pretty straightforward C# console app. It will be a process that add double variables that were passed from go part. double sum = 0; bool flag = true; while(flag) { // exit on convert error ...
dragondangun's user avatar
-1 votes
1 answer
79 views

How to keep a pointer field constant throughout the lifetime of an object (handle to a pipe in c++)

I am trying to make a handler class for dealing with a pipe in c++. I may start by saying I'm used to c#, and quite new to c++ and the concept of pointers. The only field in the class is a variable, ...
Samuel Glover's user avatar
0 votes
0 answers
32 views

Python Multiprocessing does not run concurrent when calling Class.Method() in Multiprocessing.Process

I am somewhat new to python and testing how multiprocessing works in python. I noticed that when I called a multiprocessing.process on a class object I get concurrent results (the receiver prints ...
Rambo's user avatar
  • 1
1 vote
1 answer
63 views

Why `wait` for the child when `read` could supposedly block the parent process in pipe?

I was learning pipe and communication between processes and I saw the following code to ping-pong a byte between parent and child processes: int main(int argc, char **argv) { int p[2]; char ...
Overstacked's user avatar
0 votes
1 answer
83 views

How to get Pipe and Here String in Python?

When calling a Python script via echo foobar | python myscript.py <<< test123 How can I get both strings (the "foobar" and "test123") in the Python script? When trying ...
gott18's user avatar
  • 3
0 votes
0 answers
15 views

Popen redirected to file, but file not created soonenough [duplicate]

I run an external exe from python3 that redirects to file import subprocess subprocess.Popen('app.exe > out.txt', shell=True, stdout=sub.PIPE) but after, when I check if it's created sometimes it ...
Eva4684's user avatar
  • 39
0 votes
1 answer
46 views

c++ write()/read() buffer type not working

I am writing a project using forks and pipes in c++ in Visual Studio Code and when i write the code int temptotal; write(fds[1],temptotal,sizeof(int)); or read(fds[0],temptotal,sizeof(int)); I get ...
Tearque Syrene's user avatar
1 vote
0 answers
31 views

Why is my heredoc getting input from a redirection?

I am building a program that behaves like bash while handling pipes, redirections, heredocs, etc. I have an issue with my code, which is: Every time I run a command like cat << a | sort < a....
nobody really's user avatar

1
2 3 4 5
198