I want to create a new file in Python for that I am using mknod command, but getting error as:
os.mknod();
AttributeError: module 'os' has no attribute 'mknod'
I am using windows and attributes other than 'mknod' are working.
I want to create a new file in Python for that I am using mknod command, but getting error as:
os.mknod();
AttributeError: module 'os' has no attribute 'mknod'
I am using windows and attributes other than 'mknod' are working.
Copyright © 2021 Jogjafile Inc.
osoffers functionality that is closely related to the OS you're using. If most other attributes can be accessed fromos(meaning you haven't got aos.pyfile in the current dir masking the standard module) anAttributeErrorwill 99% signal an unsupported function on your Operating System.This is what the case is with
os.mknodon Windows. Creating named pipes inWindowshas, as far as I can understand, very different semantics.Either way, if you are trying to use
mknodto create named pipes you'd probably be better usingmkfifo()(again, onlyUnixsupported) . If you're using it to create ordinary files, don't, useopen()which is portable.