Python os.mkfifo() 方法

Python 教程 · 2019-02-04 07:41:25

概述

os.mkfifo() 方法用于创建指令路径的管道,并设置权限模式。默认的模式为 0666 (八进制)。

语法

mkfifo()方法语法格式如下:

os.mkfifo(path[, mode])

参数

  • path -- 要创建的目录

  • mode -- 要为目录设置的权限数字模式

返回值

该方法没有返回值。

实例

以下实例演示了 mkfifo() 方法的使用:

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

import os, sys

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

os.mkfifo( path, 0644 )

print "路径被创建"

执行以上程序输出结果为:

路径被创建

点击查看所有 Python 教程 文章: https://codercto.com/courses/l/8.html

查看所有标签

C++ Concurrency in Action

C++ Concurrency in Action

Anthony Williams / Manning Publications / 2012-2-28 / USD 69.99

HIGHLIGHT C++ Concurrency in Action is the first book to market to show how to take advantage of the new C++ Standard and how to write robust multi-threaded applications in C++. DESCRIPTION With ......一起来看看 《C++ Concurrency in Action》 这本书的介绍吧!

URL 编码/解码
URL 编码/解码

URL 编码/解码

RGB CMYK 转换工具
RGB CMYK 转换工具

RGB CMYK 互转工具

HSV CMYK 转换工具
HSV CMYK 转换工具

HSV CMYK互换工具