Skip to main content
Filter by
Sorted by
Tagged with
0 votes
0 answers
106 views

I’m currently studying Operating Systems at college, and my professor has started teaching us about threads and pipes in C. His teaching style is very practical — he expects us not only to understand ...
Matheus Ferreira's user avatar
4 votes
1 answer
105 views

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 ...
Enlico's user avatar
  • 30.2k
3 votes
2 answers
95 views

If in a terminal I enter mkfifo /tmp/pipe echo hello > /tmp/pipe (which blocks) and in another I run the haskell program main = readFile "/tmp/foobar" >>= putStr then I see it ...
Enlico's user avatar
  • 30.2k
0 votes
2 answers
149 views

From a command I want to redirect stderr to tty and stdout+stderr to a file. How can I do that? e.g. for this: cmd.bash #!/usr/bin/bash echo "Hello World" echo "this is an error" &...
glades's user avatar
  • 5,356
1 vote
1 answer
80 views

I have been having a lot of trouble reading text a line at a time from a pipe in Python and determining when the socket has been closed on the writing end. I have had the problem when communicating ...
Steve Jorgensen's user avatar
3 votes
1 answer
183 views

I've written this small program in C, which intends to read stdin line-by-line and finally echo each line back to stdout. It is designed to stop reading input when either EOF is detected or a blank ...
user avatar
2 votes
2 answers
93 views

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 ...
avigt's user avatar
  • 600
1 vote
1 answer
85 views

Why {magrittr}'s pipe placeholder doesn't work when used in artihmetic expressions? c(10,22,35,46) %>% .[1] # 10 c(10,22,35,46) %>% .[2] # 22 c(10,22,35,46) %>% (.[2] - .[1]) # Error: object '...
robertspierre's user avatar
4 votes
1 answer
113 views

I would like to have function change value of global variable, but it fails when the function is used in a pipe: #!/bin/bash declare GVAR="abc" func1() { read GVAR echo>...
Albert Camu's user avatar
3 votes
2 answers
130 views

I'm using a bash terminal. I just wanted to peek at the first few names of installed python packages: pip list | head -n5 And got an error message: Package Version ------------------ ------...
Christopher Bottoms's user avatar
1 vote
1 answer
133 views

In a Python script, I've written: # etc. etc. input_file = args.input_file_path or sys.stdin arr = numpy.fromfile(input_file, dtype=numpy.dtype('f32')) when I run the script, I get: $ cat nums.fp32....
einpoklum's user avatar
  • 137k
0 votes
1 answer
168 views

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 ...
LavaTime's user avatar
1 vote
1 answer
39 views

I'm computing neural networks with several .py files in spyder. I could sequencely execute them in spyder. However, the console do not show any thing like single file execution. For example, this is ...
yx feng's user avatar
  • 21
2 votes
1 answer
79 views

I have two av streams, one video and one audio, i'm trying to pipe both as inputs to ffmpeg os.mkfifo(VIDEO_PIPE_NAME) os.mkfifo(AUDIO_PIPE_NAME) ffmpeg_process = subprocess.Popen([ "ffmpeg&...
Kikto's user avatar
  • 83
3 votes
1 answer
74 views

I'm trying to achieve the following: A script shall echo some strings and execute some fast returning commands and I want to see all it's stderr and stdout output on stdout and in syslog (using ...
maikelmeyers's user avatar
-2 votes
2 answers
126 views

I am trying to run a function once for each file from a large list that I am piping in. Here is some example code, here just grepping in the files whose names are coming from stdin. In my real code I ...
localhost's user avatar
  • 1,327
4 votes
1 answer
190 views

(if you suspect a XY problem, see details of what I want to do below) I need a way to automatically test functions (written by students during an exam) to check that they are behaving correctly. The ...
tobiasBora's user avatar
  • 2,594
2 votes
1 answer
69 views

My actual problem is that the input to an awk program is a file where some field in every line contains a filename, and I need to put the filesize of the file with that name into an awk variable. Here ...
Scott Petrack's user avatar
0 votes
1 answer
61 views

I'm having this weird issue that I've been staring at for a few hours now and I can't seem to figure out whats wrong. I'm writing a dependency management system for a larger project and one of the ...
mesr's user avatar
  • 266
0 votes
1 answer
131 views

I want to convert a column into a factor, and order the levels based on a different column. This works fine if I'm using the original object for the levels, e.g. below, the input object (iris) is ...
dez93_2000's user avatar
  • 1,895
0 votes
0 answers
58 views

I'm having an issue with some code I'm writing. I'm getting this pwntools error about too many files being open. My code looks like. for a in range(0,2**3360): try: with open(&...
Michael Hearn's user avatar
2 votes
3 answers
116 views

(This is a follow up to a previous question.) I want to write a Haskell program that forward its standard input to grep's (or another Linux program, fwiw) standard input, and then collects grep's ...
Enlico's user avatar
  • 30.2k
0 votes
0 answers
41 views

The API call for creating a pipe in OpenCL 2.0 and later is: cl_mem clCreatePipe( cl_context context, cl_mem_flags flags, cl_uint pipe_packet_size, cl_uint pipe_max_packets, const ...
einpoklum's user avatar
  • 137k
5 votes
1 answer
213 views

I am trying to build some example code shown on Boost web site, but a member function is used which does not seem to be part of Boost: #include <string> #include <iostream> #include <...
Pietro's user avatar
  • 13.5k
0 votes
0 answers
69 views

I am trying to implement this problem using multiprocessing and pipe as the communication between processes strategy using the following method: The producer uses a counter, pro_count, to track the ...
Phantom's user avatar
  • 83

1
2 3 4 5
208