Questions tagged [named-pipes]

A named pipe is an inter-process communication mechanism, which exists both on Unix and Unix-like systems (where it is also known as a FIFO and is file-like), and on Microsoft Windows (where it is an in-memory kernel object). The semantics and APIs differ substantially between the platforms.

Unix

On Unix and Unix-like systems a named pipe (also known as a FIFO for its behavior) is an extension to the traditional pipe concept, and is one of the methods of inter-process communication.

A traditional pipe is "unnamed" because it exists anonymously and persists only for as long as the process is running. A named pipe is system-persistent and exists beyond the life of the process and must be deleted once it is no longer being used. Processes generally attach to the named pipe (usually appearing as a file) to perform inter-process communication (IPC).

Windows

On Windows operating systems a named pipe is a named kernel object which provides duplex data transfers between two processes, a pipe server and a pipe client. Multiple completely independent instances of a particular named pipe object can be created, each connecting the pipe server to exactly one client. A pipe instance persists only as long as its server and client processes keep a handle referencing it.

Communication between the server and client via a pipe instance may be either stream-oriented or message-oriented.

1850 questions
16
votes
1 answer

PhantomJS: pipe input

I am trying to use PhantomJS to render an html page to pdf. I do not want to write the files to disk, I have the html in memory, and I want the pdf in memory. Using the excellent answer from Pooria Azimi at this question, i am able to get the pdf…
mads
  • 248
  • 2
  • 8
15
votes
2 answers

Why does the buffering of std::ifstream "break" std::getline when using LLVM?

I have a simple C++ application which is supposed to read lines from a POSIX named pipe: #include #include #include int main() { std::ifstream pipe; pipe.open("in"); std::string line; while (true) { …
krispet krispet
  • 1,648
  • 1
  • 14
  • 25
15
votes
5 answers

Is it possible to open a named pipe with command line in windows?

I want to interact with the pipe manually , but so far I can only do this in the programe,which is not very intuitive. The effect I want to achieve is a little similar to : telnet localhost 3306 tail -f file.txt Anyone get my idea?
Alan
  • 5,029
  • 5
  • 32
  • 37
15
votes
5 answers

How to create named pipe (mkfifo) in Android?

I am having trouble in creating named pipe in Android and the example below illustrates my dilemma: res = mkfifo("/sdcard/fifo9000", S_IRWXO); if (res != 0) { LOG("Error while creating a pipe (return:%d, errno:%d)", res, errno); } The code…
Ignas Limanauskas
  • 2,436
  • 7
  • 28
  • 32
15
votes
1 answer

is NetNamedPipeBinding safe?

I would like to know if netNamedPipeBinding is considered safe: On one hand NetNamedPipeBinding implements security only on the transport Layer and it uses NTLM (source) that is no longer recommended by Microsoft (source) On the other hand the Named…
darkheir
  • 8,844
  • 6
  • 45
  • 66
14
votes
1 answer

Named pipes port number

Does named pipes use ports to communicate? Named pipes i use: http://msdn.microsoft.com/en-us/library/aa365150%28VS.85%29.aspx
userbb
  • 2,148
  • 5
  • 30
  • 53
14
votes
2 answers

Can you explain in more detail what's the difference between PIPE_READMODE_MESSAGE/PIPE_READMODE_BYTE?

Though I've go through the document here, it still doesn't make sense to me what it is: Data is read from the pipe as a stream of messages. This mode can be only used if PIPE_TYPE_MESSAGE is also specified.
user198729
  • 61,774
  • 108
  • 250
  • 348
14
votes
3 answers

How to flush a pipe using bash

I have a script that writes to a named pipe and another that reads from the pipe. Occasionally, when starting the script I have noticed that the contents of the pipe exist from a previous run of the script. Is there a way to flush out the pipe at…
User1
  • 39,458
  • 69
  • 187
  • 265
14
votes
1 answer

Can't write to named pipe

I'm trying to write to a named pipe, made with mkfifo. But when I run the command, (ex) ls > myNamedPipe, I can no longer enter commands into the bash. I can still write characters and that's pretty much it.
tay10r
  • 4,234
  • 2
  • 24
  • 44
13
votes
1 answer

Is it possible to change the size of a named pipe on Linux?

I know that for the current version of the Linux kernel, the size of named pipes is 64K. Is it possible to increase this size at all? I know I can switch to sockets, but first I'd like to see if I can solve an intermittent buffer-overflow problem by…
AgentLiquid
  • 3,632
  • 7
  • 26
  • 30
13
votes
3 answers

git stderr output can't pipe

I'm writing a graphical URI handler for git:// links with bash and zenity, and I'm using a zenity 'text-info' dialog to show git's clone output while it's running, using FIFO piping. The script is about 90 lines long, so I won't bother posting it…
Delan Azabani
  • 79,602
  • 28
  • 170
  • 210
13
votes
3 answers

read not blocking on named pipe

i have the following bit of C code which reads from a pipe and then should block but it never blocks int pipe_fd; int res; int open_mode = O_RDONLY; char buf[100]; int bytes_read = 0; memset (buf, '\0', sizeof(buf)); pipe_fd = open(FIFO_NAME,…
tech74
  • 1,355
  • 3
  • 21
  • 35
13
votes
3 answers

C# Sockets vs Pipes

Currently I am working on a multi-process desktop application on Windows. This application will be a shrink wrapped application which will be deployed on client machines across the world. While we can have broad specifications for the machines -…
quixver
  • 564
  • 1
  • 4
  • 11
13
votes
1 answer

What conditions result in an opened, nonblocking named pipe (fifo) being "unavailable" for reads?

Situation: new_pipe = os.open(pipe_path, os.O_RDONLY | os.O_NONBLOCK) # pipe_path points to a FIFO data = os.read(new_pipe, 1024) The read occasionally raises errno -11: Resource temporarily unavailable. When is this error raised? It seems very…
UsAaR33
  • 3,536
  • 2
  • 34
  • 55
12
votes
3 answers

What is the purpose of maxNumberOfServerInstances in the NamedPipeServerStream class?

Currently writing a Windows service in .NET and I'm using named pipes to have other processes communicate with my service. In the more complicated constructors of NamedPipeServerStream, there's a parameter with a descriptive name of…
Sam Rueby
  • 5,914
  • 6
  • 36
  • 52