The os module provides miscellaneous operating system functionality, such as file, directory and environment variable access. More...
Constants: |
|
Functions: |
|
The os module also includes several string processing functions for extracting various components from file system paths such as directory and file extension.
IMPORTANT: The os module is currently only available for the glfw and stdcpp targets.
Copies the directory at srcpath to dstpath, creating dstpath if necessary.
If recursive is True, then subdirectories are also copied.
If hidden is True, then hidden files - files starting with a dot - are also copied.
Deletes the directory at path.
If recursive is True, then subdirectories are also deleted - use with care!
Deletes the directory at path.
If recursive is True, then subdirectories are also deleted - use with care!
Executes a shell command and returns the result. This is generally 0 for success, or non-0 for failure.
Exits the application with the given return code.
In general, ExitApp should return 0 if successful, or <0 upon failure.
Extracts and returns the directory of a file system path.
Extracts and returns the file type extension of a file system path.
Returns an integer representing the type of a file, one of: 0 for no file, 1 for a normal file, 2 for a directory.
Returns a string describing the host operating system. The returned value will be one of:
HostOS | Operating system |
---|---|
winnt | Windows |
macos | MacOS |
linux | Linux |
Loads the file names in the directory specified by path into a string array.
If recursive is True, LoadDir will also load file names in subdirectories, but will not add subdirectories to the output string array.
If hidden is True, then hidden files - files starting with a dot - are also loaded.
Loads the file names in the directory specified by path into a string array.
If recursive is True, LoadDir will also load file names in subdirectories.
If hidden is True, then hidden files - files starting with a dot - are also loaded.
Returns the real, or 'absolute', file system path corresponding to the given path.
Saves str to a file specified by path.
If a file already exists at path, it will be overwritten.
Removes both the directory and file extension from a file system path, returning just the file name.