Skip to content

Utilities

Paths and the package overview.

Files: paths.odin, doc.odin.

JoinPath :: proc(parts: ..string) -> string

Joins path parts with “/” (“a” + “b” -> “a/b”). The engine’s own: core:path/filepath needs core:os, which the web build doesn’t have. Paths in project files always use “/”.

Empty parts are skipped; a later part’s leading “/” is dropped once something is written (so an absolute path after empty parts stays absolute), and no “/” is doubled after a part that ends in one.

Inputs

  • parts: The parts, in order

Returns

  • The joined path (temp allocated)

Example

path := e.JoinPath(game.projectDir, "assets", "ship.png")
_ = path

procedure. Source: paths.odin:23