Mojo module
os
Provides functions to access operating-system dependent functionality, including file system operations.
You can import a method from the os
package. For example:
from os import listdir
from os import listdir
Aliases
-
SEEK_CUR = __init__[__mlir_type.!pop.int_literal](1)
: Seek from the current position. -
SEEK_END = __init__[__mlir_type.!pop.int_literal](2)
: Seek from the end of the file. -
SEEK_SET = __init__[__mlir_type.!pop.int_literal](0)
: Seek from the beginning of the file. -
sep = "\\" if os_is_windows() else "/"
:
Functions
-
abort
: Calls a target dependent trap instruction if available. -
getuid
: Retrieve the user ID of the calling process. -
listdir
: Gets the list of entries contained in the path provided. -
makedirs
: Creates a specified leaf directory along with any necessary intermediate directories that don't already exist. -
mkdir
: Creates a directory at the specified path. -
remove
: Removes the specified file. -
removedirs
: Removes a leaf directory and all empty intermediate ones. -
rmdir
: Removes the specified directory. -
unlink
: Removes the specified file.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!