---
title: "Path"
description: "Static path related constants and functions."
canonical_url: "https://www.zeyos.com/zymba/ref/path"
markdown_url: "https://www.zeyos.com/ai/guide/zymba/ref/path.md"
section: "zymba-reference"
authority: "reference"
language: "en"
source_repository: "https://cloud.zeyos.com/__doc/zymbaref.json"
source_sha256: "05a361c6ddc32e74f4a6dc16fd06f218210ff1b7ce57f26ca1994bfffc407915"
---

# Path

## Path

```
object @Path() {
	DIRECTORYSEPARATOR;
	MAXLENGTH;
	PATHSEPARATOR;
	fromURI(string $uri): string {}
	getBase(string $path): string {}
	getDirectory(string $path): string {}
	getExtension(string $path): string {}
	getFile(string $path): string {}
	getTempDirectory(): string {}
	getWorkingDirectory(): string {}
	hasExtension(string $path): bool {}
	isAbsolute(string $path): bool {}
	normalize(string $path): string {}
	parse(string $path): object {}
	setWorkingDirectory(string $path) {}
	toAbsolutePath(string $path): string {}
	toRealPath(string $path): string {}
	toURI(string $path): string {}
}
```

**Static path related constants and functions.**

## Functions


### `@Path.fromURI()`


Converts a file URI to a path.

```code
@Path.fromURI(string $uri): string
```

##### Parameters

| Name | Type | Value | Default |
| --- | --- | --- | --- |
| uri | `string`  |  | "" |

##### Returns

| Type | Value |
| --- | ---  |
| `string` |  |




### `@Path.getBase()`


Gets the base name component of a path (including extension).

```code
@Path.getBase(string $path): string
```

##### Parameters

| Name | Type | Value | Default |
| --- | --- | --- | --- |
| path | `string`  |  | "" |

##### Returns

| Type | Value |
| --- | ---  |
| `string` |  |




### `@Path.getDirectory()`


Gets the directory name component of a path.

```code
@Path.getDirectory(string $path): string
```

##### Parameters

| Name | Type | Value | Default |
| --- | --- | --- | --- |
| path | `string`  |  | "" |

##### Returns

| Type | Value |
| --- | ---  |
| `string` |  |




### `@Path.getExtension()`


Gets the file extension component of a path.

```code
@Path.getExtension(string $path): string
```

##### Parameters

| Name | Type | Value | Default |
| --- | --- | --- | --- |
| path | `string`  |  | "" |

##### Returns

| Type | Value |
| --- | ---  |
| `string` |  |




### `@Path.getFile()`


Gets the filename component of a path (excluding extension).

```code
@Path.getFile(string $path): string
```

##### Parameters

| Name | Type | Value | Default |
| --- | --- | --- | --- |
| path | `string`  |  | "" |

##### Returns

| Type | Value |
| --- | ---  |
| `string` |  |




### `@Path.getTempDirectory()`


Gets the absolute path of the system's directory for temporary files.

```code
@Path.getTempDirectory(): string
```

##### Returns

| Type | Value |
| --- | ---  |
| `string` |  |




### `@Path.getWorkingDirectory()`


Gets the absolute path of the current working directory.

```code
@Path.getWorkingDirectory(): string
```

##### Returns

| Type | Value |
| --- | ---  |
| `string` |  |




### `@Path.hasExtension()`


Determines whether a path has a file extension component.

```code
@Path.hasExtension(string $path): bool
```

##### Parameters

| Name | Type | Value | Default |
| --- | --- | --- | --- |
| path | `string`  |  | "" |

##### Returns

| Type | Value |
| --- | ---  |
| `bool` |  |




### `@Path.isAbsolute()`


Determines whether a path is absolute.

```code
@Path.isAbsolute(string $path): bool
```

##### Parameters

| Name | Type | Value | Default |
| --- | --- | --- | --- |
| path | `string`  |  | "" |

##### Returns

| Type | Value |
| --- | ---  |
| `bool` |  |




### `@Path.normalize()`


Normalizes a path to its canonicalized representation.

```code
@Path.normalize(string $path): string
```

##### Parameters

| Name | Type | Value | Default |
| --- | --- | --- | --- |
| path | `string`  |  | "" |

##### Returns

| Type | Value |
| --- | ---  |
| `string` |  |




### `@Path.parse()`


```code
@Path.parse(string $path): object
```

##### Parameters

| Name | Type | Value | Default |
| --- | --- | --- | --- |
| path | `string`  |  | "" |

##### Returns

| Type | Value |
| --- | ---  |
| `object` | ["directory": ..., "file": ..., "extension": ...] |




### `@Path.setWorkingDirectory()`


Sets the path of the working directory.

```code
@Path.setWorkingDirectory(string $path): void
```

##### Parameters

| Name | Type | Value | Default |
| --- | --- | --- | --- |
| path | `string`  |  | "" |




### `@Path.toAbsolutePath()`


Converts a path to its canonicalized absolute path.

```code
@Path.toAbsolutePath(string $path): string
```

##### Parameters

| Name | Type | Value | Default |
| --- | --- | --- | --- |
| path | `string`  |  | "" |

##### Returns

| Type | Value |
| --- | ---  |
| `string` |  |




### `@Path.toRealPath()`


Converts a path to the canonicalized absolute path of an existing file, resolving all symbolic links.

```code
@Path.toRealPath(string $path): string
```

##### Parameters

| Name | Type | Value | Default |
| --- | --- | --- | --- |
| path | `string`  |  | "" |

##### Returns

| Type | Value |
| --- | ---  |
| `string` |  |




### `@Path.toURI()`


Converts a path to a file URI.

```code
@Path.toURI(string $path): string
```

##### Parameters

| Name | Type | Value | Default |
| --- | --- | --- | --- |
| path | `string`  |  | "" |

##### Returns

| Type | Value |
| --- | ---  |
| `string` |  |
