Latest web development tutorials

Python os.mkfifo () method

Python File (File) method Python OS file / directory methods


Outline

os.mkfifo () method is used to create the path instruction pipeline, and set permissions mode. The default mode is 0666 (octal).

grammar

mkfifo () method syntax is as follows:

os.mkfifo(path[, mode])

parameter

  • path - the directory to be created

  • mode - authority digital mode To set directory

return value

This method has no return value.

Examples

The following example demonstrates mkfifo () method of use:

#!/usr/bin/python
# -*- coding: UTF-8 -*-

import os, sys

# 创建的目录
path = "/tmp/hourly"

os.mkfifo( path, 0644 )

print "路径被创建"

The above program output is:

路径被创建

Python File (File) method Python OS file / directory methods