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

Python os.mkfifo() method

Python os.mkfifo() method

Python File methods Python 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/python

# -*- coding: UTF-8 -*-



import os, sys



# Created directory

path = "/tmp/hourly"



os.mkfifo( path, 0644 )



print "路径被创建"

The output of the above program is:



路径被创建

Python File methods Python OS file/directory methods