go-container/specs/internal/coreutil.md

1 KiB

coreutil

Import: dappco.re/go/core/container/internal/coreutil Files: 1

Types

Functions

Exported Functions

  • DirSep() string: Returns the active directory separator, preferring the DS environment variable and otherwise /.
  • JoinPath(parts ...string) string: Joins path elements with DirSep() and normalizes the result with core.CleanPath.
  • HomeDir() string: Returns the home directory by checking CORE_HOME, HOME, USERPROFILE, and then DIR_HOME.
  • CurrentDir() string: Returns the current working directory from PWD, or DIR_CWD when PWD is unset.
  • TempDir() string: Returns the temporary directory from TMPDIR, or DIR_TMP when TMPDIR is unset.
  • AbsPath(path string) string: Returns CurrentDir() for an empty string, preserves absolute paths, and otherwise resolves relative paths against the current directory.
  • MkdirTemp(prefix string) (string, error): Creates a deterministic temporary directory inside TempDir() using the supplied prefix or tmp- when no prefix is provided.