os.Path.isroot

Checks if a file path is a root path.

Syntax

os.Path.isroot(
   path STRING)
  RETURNING result BOOLEAN
  1. path is the path to check.

Usage

The function returns TRUE if the path is a root path, FALSE otherwise.

On UNIX™ the root path is '/'.

On Windows™ the root path matches "[a-zA-Z]:\".