MySQL Shell API 8.4.0
Unified development interface for MySQL Products
Methods | List of all members
Path Class Reference

Gives access to path-related functions. More...

Methods

String basename (String path)
 Provides the base name from the given path, by stripping the components before the last path-separator character. More...
 
String dirname (String path)
 Provides the directory name from the given path, by stripping the component after the last path-separator character. More...
 
Bool isabs (String path)
 Checks if the given path is absolute. More...
 
Bool isdir (String path)
 Checks if the given path exists and is a directory. More...
 
Bool isfile (String path)
 Checks if the given path exists and is a file. More...
 
String join (String pathA, String pathB, String pathC, String pathD)
 Joins the path components using the path-separator character. More...
 
String normpath (String path)
 Normalizes the given path, collapsing redundant path-separator characters and relative references. More...
 

Detailed Description

Gives access to path-related functions.

Member Function Documentation

◆ basename()

String basename ( String  path)

Provides the base name from the given path, by stripping the components before the last path-separator character.

Parameters
pathA file-system path.
Returns
The base name of the given path.

◆ dirname()

String dirname ( String  path)

Provides the directory name from the given path, by stripping the component after the last path-separator character.

Parameters
pathA file-system path.
Returns
The directory name of the given path.

◆ isabs()

Bool isabs ( String  path)

Checks if the given path is absolute.

Parameters
pathA file-system path.
Returns
true if the given path is absolute.

◆ isdir()

Bool isdir ( String  path)

Checks if the given path exists and is a directory.

Parameters
pathA file-system path.
Returns
true if path points to an existing directory.

◆ isfile()

Bool isfile ( String  path)

Checks if the given path exists and is a file.

Parameters
pathA file-system path.
Returns
true if path points to an existing file.

◆ join()

String join ( String  pathA,
String  pathB,
String  pathC,
String  pathD 
)

Joins the path components using the path-separator character.

Parameters
pathAA file-system path component.
pathBA file-system path component.
pathCOptional A file-system path component.
pathDOptional A file-system path component.
Returns
The joined path.

If a component is an absolute path, the current result is discarded and replaced with the current component.

◆ normpath()

String normpath ( String  path)

Normalizes the given path, collapsing redundant path-separator characters and relative references.

Parameters
pathA file-system path component.
Returns
The normalized path.