Python os.get_blocking() Method
Example
Find the blocking mode of file:
#Import os Library
import os
#Open a file
fd = os.open("file.txt", os.O_RDWR)
#Print the blocking mode of file descriptor
print (os.get_blocking(fd))
Definition and Usage
The os.get_blocking()
returns the blocking mode information of the file descriptor.
Blocking mode means input/output system calls like read, write, or connect can be blocked by the system.
Syntax
os.get_blocking(fd)
Parameter Values
Parameter | Description |
---|---|
fd | Required. A file descriptor to be checked |
Technical Details
Return Value: | A bool value. Returns TRUE if the file descriptor is in blocking mode else returns FALSE
|
---|---|
Python Version: | 3.5 |