Python os.mkfifo() Method
Example
Create a FIFO named path with specified mode:
#Import os Library
import os, sys
# Create a FIFO named path with the mode specified
os.mkfifo('/tmp/test', 0o644)
Definition and Usage
The os.mkfifo() method is creates a FIFO named path with the specified mode.
FIFO is a named pipe that can be accessed as regular files.
Syntax
os.mkfifo(path, mode, * , dir_fd)
Parameter Values
| Parameter | Description |
|---|---|
| path | Required. A String or bytes object representing a file system path. |
| mode | Optional. Represent a numeric value of FIFO to be created. The default value is 0o666 |
| * | Optional. The '*' in parameter list represents that all following parameters are keyword-only parameters and they can be provided using their name, not as a positional parameter. |
| dir_fd | Optional. Represent a directory. The default value of this parameter is None. |
Technical Details
| Return Value: | None |
|---|---|
| Python Version: | pre 2.6 |
| Change Log: | 3.3 - Added the dir_fd parameter 3.6 - Accepts a path-like object |