Python 3 - os.mkfifo() Method


Description

The method mkfifo() create a FIFO named path with numeric mode. The default mode is 0666 (octal).The current umask value is first masked out.

FIFOs are pipes that can be accessed like regular files. FIFOs exist until they are deleted

Syntax

Following is the syntax for mkfifo() method −

os.mkfifo(path[, mode])

Parameters

  • path − This is the path, which needs to be created.

  • mode − This is the mode of the named path to be given.

Return Value

This method does not return any value.

Example

The following example shows the usage of mkfifo() method.

# !/usr/bin/python3
import os, sys

# Path to be created
path = "/tmp/hourly"
os.mkfifo( path, 0644 )

print ("Path is created")

Result

When we run the above program, it produces the following result −

Path is created
python_files_io.htm
Advertisements