os.Path.rootdir

Returns the root directory of the current working path.

Syntax

os.Path.rootdir()
  RETURNING rootdir STRING
  1. rootdir is the root directory of the current working path.

Usage

On UNIX™, it always returns "/".

On Windows™ it returns the current working drive as "[a-zA-Z]:\"