Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/windows/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
windows中的Python os.mknod_Python_Windows_Python 3.x_Windows 7_Python 3.5 - Fatal编程技术网

windows中的Python os.mknod

windows中的Python os.mknod,python,windows,python-3.x,windows-7,python-3.5,Python,Windows,Python 3.x,Windows 7,Python 3.5,我试图在Windows 7中使用Python 3.5.0中的os.mknod函数,但发现错误: Traceback (most recent call last): File "<pyshell#1>", line 1, in <module> os.mknod AttributeError: module 'os' has no attribute 'mknod' 回溯(最近一次呼叫最后一次): 文件“”,第1行,在 os.mknod AttributeE

我试图在Windows 7中使用Python 3.5.0中的
os.mknod
函数,但发现错误:

Traceback (most recent call last):
  File "<pyshell#1>", line 1, in <module>
    os.mknod
AttributeError: module 'os' has no attribute 'mknod'
回溯(最近一次呼叫最后一次):
文件“”,第1行,在
os.mknod
AttributeError:模块“os”没有属性“mknod”
我想它应该在那里,因为它没有说任何关于有限可用性的内容。Windows中的类似功能是否还有其他选项可供使用?我只是想在一个特定的路径中创建一个空文件,我想调用
open(path,'w')
会有点难看

我不知道这是否是版本特定的问题,因为我以前从未在Windows中使用过Python。

因为,这是:

可用性:Unix


这个问题很难回答,但没有答案。是的,我找到了:(但是我试图提供更多关于我的具体问题的信息(操作系统、版本等)并且可能要求提供替代方案。在Windows上没有直接等效的。设备使用
\.\
前缀。设备名称通过每次登录创建,但实际的设备对象目标由驱动程序创建。例如,
\.\nul
指向本机
\Device\Null
的链接。命名管道通过创建并通过访问命名管道文件系统,
\.\pipe
(本机
\Device\NamedPipe
)。文件系统目录是通过创建的。常规文件是通过创建和打开的,它还可以打开前缀为
\.\
的设备。因此,这基本上意味着除了
打开
,没有可移植的方法来创建空文件?