Engineers Garage

  • Electronic Projects & Tutorials
    • Electronic Projects
      • Arduino Projects
      • AVR
      • Raspberry pi
      • ESP8266
      • BeagleBone
      • 8051 Microcontroller
      • ARM
      • PIC Microcontroller
      • STM32
    • Tutorials
      • Complete Sensor Guide
      • Engineering Deep Dives
      • AI
      • ARDUINO Compatible Coding
      • Audio Electronics
      • Battery Management
      • Beginners Electronics Series
      • Brainwave
      • Digital electronics (DE)
      • Electric Vehicles
      • EMI/EMC/RFI
      • EVs
      • Hardware Filters
      • IoT tutorials
      • LoRa/LoRaWAN
      • Power Tutorials
      • Protocol
      • Python
      • RPI Python Programming
      • Sensors
      • USB
      • Thermal management
      • Verilog
      • VHDL
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Product News
    • Business News
    • Company/Start-up News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • DigiKey Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Learn
    • Design Guides
    • Learning Center
    • Tech Toolboxes
    • Tech Terms
    • Webinars & Digital Events
  • Resources
    • EE Training Days
    • LEAP Awards
    • Podcasts
    • White Papers
  • Guest Post Guidelines
  • Advertise
  • Subscribe

FIFO or named Pipe ( Part 16/24)

By Ashish Vara September 8, 2016

FIFO or named Pipe

I already explained about pipe in tutorial Pipe in Linux. FIFO or unnamed pipe is same as pipe or named pipe except for one thing. Pipe is a one way communication between process which is related to each other like parent and child processes. Related processes have same file descriptor, so they communicate easily through single pipe but unrelated processes have different file descriptors, so they cannot communicate through single pipe. You can communicate only through creating multiple pipes each for one communication.  Communication between multiple processes is not sufficient and hence FIFO or named pipe overcomes this limitation.

FIFO (First In First Out) is first out file which is like normal file but doesn’t save the content of file, it should pass data, write or read by first in and first out process. When one process is read or written using FIFO, another process waits   to access FIFO. So FIFO can also be used for one-way communication between multiple and unrelated processes instead of single and related process.  It  creates file inode in virtual file system same as normal file  with similar characteristics. During communication if reading or writing of any process is stopped or closed,  it’s called broken pipe. It is simple, if names are given to pipe, then one would be able to read or write data to them just like a normal file.

You can communicate between unrelated processes through FIFO or named pipe by shell command.  To create named pipe, you can use following command from terminal:

Syntax:

mkfifo file_name 

  Here, file_name is indicating the name of pipe.

  You can use another way  to create FIFO or named pipe by following command:  

mknode file_name p

  Here, file_name indicates that the name of pipe and p  indicates of file type named pipe.

 

Let’s see one example of how to communicate two processes through named pipe.

I want to convert text file to compressed file through named pipe. Suppose I have text file named pipe.txt.

First I will create FIFO or named pipe using mkfifo command.

For example,

            mkfifo pipe_fifo

 Similarly I can create FIFO or named pipe using mknod command.

For example,

            mknod pipe_fifo p

You can create named pipe using any method as I explained here.

After creating named pipe, you can use it to communicate between two processes. Now, you will be able to share data between the two processes.

I can share the data of pipe.txt file with FIFO by following line:

            cat pipe.txt > pipe_fifo

Here content of pipe.txt is shared with named pipe pipe_fifo. File pipe.txt writes data into pipe_fifo file.

After pressing ENTER key, process is in running mode, so you cannot enter another command from command terminal. Open another command terminal for reading data from pipe_fifo and convert it into compressed file. We can read from pipe_fifo and convert it into compressed file (i.e. ZIP File) by following command line:

            gzip –q –c < pipe_fifo > pipe_compressed.gz

 Now pipe.txt file is converted into zip file named pipe_compressed.gz. As soon as  you enter command in second terminal the process stops and exits from running mode.

Note: when you open another terminal, do not close first running terminal.

In next tutorial, I will explain how to create named pipe or FIFO in C programming.


Filed Under: Tutorials

 

Next Article

← Previous Article
Next Article →

Questions related to this article?
👉Ask and discuss on EDAboard.com and Electro-Tech-Online.com forums.



Tell Us What You Think!! Cancel reply

Log in to leave a comment:

Lost your password?

Don't have an account? Register here

Submit a Guest Post

submit a guest post

EE TECH TOOLBOX

“ee
Tech Toolbox: Wide Bandgap Semiconductors
Moving from silicon to GaN or SiC feels like a whole new ballgame, doesn’t it? It isn’t just about faster switching; it’s about managing the layout parasitics and thermal realities that come with that speed. This month’s Tech Toolbox features a curated eBook that tackles these design hurdles head-on.

EE Learning Center

EE Learning Center
“engineers
EXPAND YOUR KNOWLEDGE AND STAY CONNECTED
Get the latest info on technologies, tools and strategies for EE professionals.

HAVE A QUESTION?

Have a technical question about an article or other engineering questions? Check out our engineering forums EDABoard.com and Electro-Tech-Online.com where you can get those questions asked and answered by your peers!


RSS feed: EDABOARD.com Discussions. EDABOARD.com Discussions.

  • Request for a 5W transistor controlled LED flash light controller circuit review
  • Need Help to design an array antenna
  • fourier transform, wdm, far field near field and magic resistor values
  • Industrial relevance of LC-QVCOs and the value of phase/amplitude compensation
  • Trying to disable DRC in KICAD.

RSS feed: Electro-Tech-Online.com Discussions Electro-Tech-Online.com Discussions

  • Request for a 5W transistor controlled LED flash light controller circuit review
  • What should be checked before sending a PCB design for manufacturing?
  • Speed control on power tools...
  • How much does generator frequency stability matter for sensitive electrical equipment?
  • Curiosity is difficult.

Featured Tutorials

VHDL Series (1-24)

  • VHDL Tutorial 17: Design a JK flip-flop (with preset and clear) using VHDL
    VHDL Tutorial 17: Design a JK flip-flop (with preset and clear) using VHDL
  • VHDL Tutorial 18: Design a T flip-flop (with enable and an active high reset input) using VHDL
    VHDL Tutorial 18: Design a T flip-flop (with enable and an active high reset input) using VHDL
  • VHDL Tutorial – 19: Designing a 4-bit binary counter using VHDL
    VHDL Tutorial – 19: Designing a 4-bit binary counter using VHDL
  • VHDL Tutorial – 20: Designing 4-bit binary-to-gray & gray-to-binary code converters
    VHDL Tutorial – 20: Designing 4-bit binary-to-gray & gray-to-binary code converters
  • VHDL Tutorial – 21: Designing an 8-bit, full-adder circuit using VHDL
    VHDL Tutorial – 21: Designing an 8-bit, full-adder circuit using VHDL
  • VHDL Tutorial – 22: Designing a 1-bit & an 8-bit comparator by using VHDL
    VHDL Tutorial – 22: Designing a 1-bit & an 8-bit comparator by using VHDL
More Tutorials >

Recent Articles

  • Infineon introduces 27 kW three-phase AI server PSU
  • Mini-Circuits releases Butler matrices for MIMO testing
  • OMNIVISION introduces 12MP global shutter image sensor
  • OMNIVISION launches 5MP global shutter image sensor
  • TDK expands inductors for automotive PoC circuits

EE ENGINEERING TRAINING DAYS

engineering
Engineers Garage
  • Analog IC TIps
  • Connector Tips
  • Battery Power Tips
  • EDABoard Forums
  • EE World Online
  • Electro-Tech-Online Forums
  • EV Engineering
  • Microcontroller Tips
  • Power Electronic Tips
  • Sensor Tips
  • Test and Measurement Tips
  • 5G Technology World
  • Subscribe to our newsletter
  • About Us
  • Contact Us
  • Advertise

Copyright © 2026 Arrowfly LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of Arrowfly
Privacy Policy

Search Engineers Garage

  • Electronic Projects & Tutorials
    • Electronic Projects
      • Arduino Projects
      • AVR
      • Raspberry pi
      • ESP8266
      • BeagleBone
      • 8051 Microcontroller
      • ARM
      • PIC Microcontroller
      • STM32
    • Tutorials
      • Complete Sensor Guide
      • Engineering Deep Dives
      • AI
      • ARDUINO Compatible Coding
      • Audio Electronics
      • Battery Management
      • Beginners Electronics Series
      • Brainwave
      • Digital electronics (DE)
      • Electric Vehicles
      • EMI/EMC/RFI
      • EVs
      • Hardware Filters
      • IoT tutorials
      • LoRa/LoRaWAN
      • Power Tutorials
      • Protocol
      • Python
      • RPI Python Programming
      • Sensors
      • USB
      • Thermal management
      • Verilog
      • VHDL
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Product News
    • Business News
    • Company/Start-up News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • DigiKey Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Learn
    • Design Guides
    • Learning Center
    • Tech Toolboxes
    • Tech Terms
    • Webinars & Digital Events
  • Resources
    • EE Training Days
    • LEAP Awards
    • Podcasts
    • White Papers
  • Guest Post Guidelines
  • Advertise
  • Subscribe