os.supports_dir_fd
A Set
object indicating which functions in the os
module permit use of their dir_fd parameter. Different platforms provide different functionality, and an option that might work on one might be unsupported on another. For consistency’s sakes, functions that support dir_fd always allow specifying the parameter, but will raise an exception if the functionality is not actually available.
To check whether a particular function permits use of its dir_fd parameter, use the in
operator on supports_dir_fd
. As an example, this expression determines whether the dir_fd parameter of os.stat()
is locally available:
os.stat in os.supports_dir_fd
Currently dir_fd parameters only work on Unix platforms; none of them work on Windows.
New in version 3.3.
Please login to continue.