PLUG-discuss digest, Vol 1 #4200 - 13 msgs

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Jeremy C. Reed
Date:  
Subject: PLUG-discuss digest, Vol 1 #4200 - 13 msgs
On Wed, 10 Dec 2003, Alexander Henry wrote:

> WTF is a FIFO?


first in/first out.

On a Linux box, mkfifo is included with the coreutils software.

Try "info mkfifo" or "man mkfifo".

A FIFO is also called a "named pipe".

You can write data to the file (made by mkfifo) and then read that same
data.

rainier:~$ mkfifo ~/tmp/myfifo
rainier:~$ echo hello > ~/tmp/myfifo &
[1] 15259
rainier:~$ cat ~/tmp/myfifo
hello
[1]+  Done                    echo hello >~/tmp/myfifo



Better yet, do above on different consoles without using ampersand. And
you will see how it blocks until it's read.

That example is to simple.

Another example is having a script that creates a new signature for every
mail.

So, you would have a loop writing new signatures to the fifo file. It will
block until it is read (so the loop won't continue until that data is
read), then next time will have new signature.

Jeremy C. Reed
http://www.reedmedia.net/