Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

Python3 os.mkfifo() Method

Python3 os.mkfifo() Method

Python3 OS File/Directory Methods Python3 OS File/Directory Methods


Overview

The os.mkfifo() method creates a pipe at the specified path and sets the permission mode. The default mode is 0666 (octal).

Syntax

The **mkfifo()** method syntax is as follows:


os.mkfifo(path[, mode])

Parameters

Return Value

This method has no return value.

Example

The following example demonstrates the use of the mkfifo() method:


#!/usr/bin/python3

import os, sys

# Created directory
path = "/tmp/hourly"

os.mkfifo( path, 0644 )

print ("路径被创建")

The output of the above program is:


路径被创建

Python3 OS File/Directory Methods Python3 OS File/Directory Methods