{"id":4173,"date":"2024-04-27T10:47:53","date_gmt":"2024-04-27T05:17:53","guid":{"rendered":"https:\/\/cthecosmos.com\/?p=4173"},"modified":"2024-04-27T10:48:50","modified_gmt":"2024-04-27T05:18:50","slug":"%f0%9d%91%be%f0%9d%92%89%f0%9d%92%82%f0%9d%92%95-%f0%9d%92%8a%f0%9d%92%94-%f0%9d%92%82-%f0%9d%91%ad%f0%9d%91%b0%f0%9d%91%ad%f0%9d%91%b6","status":"publish","type":"post","link":"https:\/\/cthecosmos.com\/?p=4173","title":{"rendered":"\ud835\udc7e\ud835\udc89\ud835\udc82\ud835\udc95 \ud835\udc8a\ud835\udc94 \ud835\udc82 \ud835\udc6d\ud835\udc70\ud835\udc6d\ud835\udc76?"},"content":{"rendered":"\n<p class=\"has-black-color has-white-background-color has-text-color has-background has-link-color wp-elements-ed8a255f42ff786bb22c51f3d37202e3\" style=\"font-size:17px;line-height:1.8\">\ud835\udc68\ud835\udc87\ud835\udc95\ud835\udc86\ud835\udc93 \ud835\udc95\ud835\udc89\ud835\udc82\ud835\udc95 \ud835\udc90\ud835\udc97\ud835\udc86\ud835\udc93\ud835\udc97\ud835\udc8a\ud835\udc86\ud835\udc98 \ud835\udc90\ud835\udc87 \ud835\udc91\ud835\udc8a\ud835\udc91\ud835\udc86\ud835\udc94, let&#8217;s delve deeper into the realm of named pipes. Did you know? \ud835\udc6d\ud835\udc70\ud835\udc6d\ud835\udc76s are also affectionately termed as named pipes.<br><br>\ud83e\udd13 Let&#8217;s unravel this mystery together!<br><br>\ud83d\udcdc&nbsp;\ud835\udc7e\ud835\udc89\ud835\udc82\ud835\udc95 \ud835\udc8a\ud835\udc94 \ud835\udc82 \ud835\udc6d\ud835\udc70\ud835\udc6d\ud835\udc76?<br><br>FIFO, an acronym for &#8220;First In, First Out&#8221;, embodies the idea that the first element added is also the first to depart. \ud83d\udeb6\u200d\u2642\ufe0f Think of it like standing in line for a golgappa stall \ud83e\udd63. The first one in line gets the first serve, right?<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1000\" height=\"463\" data-attachment-id=\"4175\" data-permalink=\"https:\/\/cthecosmos.com\/?attachment_id=4175\" data-orig-file=\"https:\/\/i0.wp.com\/cthecosmos.com\/wp-content\/uploads\/2024\/04\/ponfifo1.png?fit=3410%2C1580&amp;ssl=1\" data-orig-size=\"3410,1580\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"ponfifo1\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/cthecosmos.com\/wp-content\/uploads\/2024\/04\/ponfifo1.png?fit=1000%2C463&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/cthecosmos.com\/wp-content\/uploads\/2024\/04\/ponfifo1.png?resize=1000%2C463&#038;ssl=1\" alt=\"\" class=\"wp-image-4175\" \/><\/figure>\n\n\n\n<p class=\"has-black-color has-white-background-color has-text-color has-background has-link-color wp-elements-d6a2ae0cb25c4bc9c464634c34256551\" style=\"font-size:17px;line-height:1.8\"><br><br>\ud83d\udc27 \ud835\udc6d\ud835\udc70\ud835\udc6d\ud835\udc76: \ud835\udc7b\ud835\udc89\ud835\udc86 \ud835\udc75\ud835\udc82\ud835\udc8e\ud835\udc86\ud835\udc85 \ud835\udc77\ud835\udc8a\ud835\udc91\ud835\udc86 \ud835\udc8a\ud835\udc8f \ud835\udc95\ud835\udc89\ud835\udc86 \ud835\udc73\ud835\udc8a\ud835\udc8f\ud835\udc96\ud835\udc99 \ud835\udc7e\ud835\udc90\ud835\udc93\ud835\udc8d\ud835\udc85<br><br>While we harness &#8220;unnamed&#8221; pipes for that crucial inter-process communication (IPC), named pipes, our esteemed FIFOs, shine bright. Why? They&#8217;re anchored firmly within the file system. \ud83d\udcc2 This distinctive feature crafts bridges of communication between two unrelated processes.<br><br>\ud83d\udee0 \ud835\udc6a\ud835\udc93\ud835\udc82\ud835\udc87\ud835\udc95\ud835\udc8a\ud835\udc8f\ud835\udc88 \ud835\udc82 \ud835\udc6d\ud835\udc70\ud835\udc6d\ud835\udc76:<br><br>mkfifo a_named_pipe<br><br>Launch `ls -l` to peek into your directory. A hint: Look out for the &#8216;p&#8217; prefix \u2013 that&#8217;s the hallmark of its pipe identity! \ud83d\udd75\ufe0f\u200d\u2642\ufe0f<br><br>\ud83d\udd27 Communicating Using Named Pipes with C Programming:<br><br>\ud835\udc7e\ud835\udc93\ud835\udc8a\ud835\udc95\ud835\udc8a\ud835\udc8f\ud835\udc88 \ud835\udc98\ud835\udc8a\ud835\udc95\ud835\udc89 \ud835\udc6d\ud835\udc70\ud835\udc6d\ud835\udc76:<br>char * my_pipe = &#8220;\/tmp\/my_named_pipe&#8221;;<br>&#8230;<br>fd = open(my_pipe, O_WRONLY);<br>&#8230;<br><br>\ud835\udc79\ud835\udc86\ud835\udc82\ud835\udc85\ud835\udc8a\ud835\udc8f\ud835\udc88 \ud835\udc98\ud835\udc8a\ud835\udc95\ud835\udc89 \ud835\udc6d\ud835\udc70\ud835\udc6d\ud835\udc76:<br>char * my_pipe = &#8220;\/tmp\/my_named_pipe&#8221;;<br>&#8230;<br>fd = open(my_pipe, O_RDONLY);<br>&#8230;<br><br>It&#8217;s like sending and receiving secret messages! \ud83d\udc8c<br><br>\ud83c\udf1f \ud835\udc7e\ud835\udc89\ud835\udc9a \ud835\udc7c\ud835\udc94\ud835\udc86 \ud835\udc6d\ud835\udc70\ud835\udc6d\ud835\udc76\ud835\udc94?<br>Inter-process Communication: FIFOs, wearing the cape of named pipes, act as intermediaries between distinct processes.<br><br>Persistence: Think of FIFOs as the reliable friend who&#8217;s always there for you. Even as everything keeps changing in tech, FIFOs stay right where you left them in the filesystem, unlike some other types of pipes that disappear.<br><br>Flexibility: FIFOs are like your everyday files. You can easily read from them or write to them without any fuss. It&#8217;s like having a notebook \ud83d\udcd6 that&#8217;s always ready for your notes \u270d\ufe0f.<br><br>FIFOs in Linux are nothing short of magical wands, empowering processes to have heart-to-heart chats. Whether you&#8217;re a code maestro or just setting sail, acquainting yourself with FIFO can augment your admiration for Linux&#8217;s prowess. So, as you sip on your next coffee, \ud83c\udf75 let your thoughts wander to the symphony of order that FIFOs infuse into computing.<br><br>If this exploration lit the bulb of insight \ud83d\udca1, do shower it with love and share the knowledge. \ud83c\udf0d<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p class=\"has-black-color has-white-background-color has-text-color has-background has-link-color wp-elements-344881b85cebf7a3b18304a8398f4995\" style=\"font-size:17px\">LinkedIn Post: <a href=\"https:\/\/www.linkedin.com\/posts\/t-yashwanth-naidu_earlycareer-embeddedsystems-learning-activity-7107186884543463426-q2lJ\/?utm_source=share&amp;utm_medium=member_desktop\">https:\/\/www.linkedin.com\/posts\/t-yashwanth-naidu_earlycareer-embeddedsystems-learning-activity-7107186884543463426-q2lJ\/?utm_source=share&amp;utm_medium=member_desktop<\/a><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p class=\"has-white-color has-text-color has-background has-link-color has-medium-font-size wp-elements-486e7799b35920eece0029316d5e98bd\" style=\"background:linear-gradient(135deg,rgb(35,23,11) 0%,rgb(254,45,45) 50%,rgb(107,0,62) 100%)\">~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br><strong>An Article by: <\/strong>Yashwanth Naidu Tikkisetty<br>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Named pipes, also known as FIFOs, are essential in inter-process communication. They embody the &#8220;First In, First Out&#8221; concept, serving as intermediaries between processes. Positioned within the file system, they enable seamless communication and offer persistence and flexibility. Understanding named pipes is key to fully appreciate Linux&#8217;s capabilities and empower your programming endeavors.<\/p>\n<a href=\"https:\/\/cthecosmos.com\/?p=4173\" class=\"more-link\">Read More <span class=\"screen-reader-text\">\ud835\udc7e\ud835\udc89\ud835\udc82\ud835\udc95 \ud835\udc8a\ud835\udc94 \ud835\udc82 \ud835\udc6d\ud835\udc70\ud835\udc6d\ud835\udc76?<\/span><\/a>","protected":false},"author":120055267,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":false,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"_wpas_customize_per_network":false,"jetpack_post_was_ever_published":false},"categories":[769112296,36985,28627,30181,5495,952411],"tags":[772321195,772321193,371637,12281096,88204,771201861,79812,1354040,34920936],"class_list":["post-4173","post","type-post","status-publish","format-standard","hentry","category-c-concepts-hub","category-c-programming","category-embedded","category-embedded-systems","category-operating-system","category-short-articles","tag-c-programming","tag-embedded-systems","tag-ipc","tag-ipc-mechanism","tag-linux-fun","tag-linuxlearning-2","tag-pipes","tag-short-article","tag-ubuntu-2","has-post-thumbnail","fallback-thumbnail"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_likes_enabled":true,"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8CiEf-15j","jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/cthecosmos.com\/index.php?rest_route=\/wp\/v2\/posts\/4173","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cthecosmos.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cthecosmos.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cthecosmos.com\/index.php?rest_route=\/wp\/v2\/users\/120055267"}],"replies":[{"embeddable":true,"href":"https:\/\/cthecosmos.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4173"}],"version-history":[{"count":5,"href":"https:\/\/cthecosmos.com\/index.php?rest_route=\/wp\/v2\/posts\/4173\/revisions"}],"predecessor-version":[{"id":4179,"href":"https:\/\/cthecosmos.com\/index.php?rest_route=\/wp\/v2\/posts\/4173\/revisions\/4179"}],"wp:attachment":[{"href":"https:\/\/cthecosmos.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4173"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cthecosmos.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4173"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cthecosmos.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4173"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}