Help us shape the future of Go! Take the 2026 Go Developer Survey

devmount

package
v0.1.48 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 27, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package devmount owns the package a development session mounts in a Deadlock installation: its directory, its block in gameinfo.gi, and the lock that tells a live session from one that ended without unmounting. Each package lives in its own subdirectory named for its content, since a running game holds the package it loaded open and Windows refuses to replace it; a changed package goes beside the held one, and the next session prunes the ones no game holds. Another program that mounts content in the same game, such as a game client that refuses to start beside conflicting packages, clears a stale mount through ClearStale instead of asking the player to edit gameinfo.gi.

Index

Constants

View Source
const (
	// Name names the session's block in gameinfo.gi.
	Name = "MODLOCK DEV"
	// Dir is the game-relative directory of the session's packages.
	Dir = "citadel/modlock_dev"
)

Variables

View Source
var ErrRunning = errors.New("a Modlock development session is running in this game")

ErrRunning reports that a live development session holds the mount.

Functions

func ClearStale

func ClearStale(gameDir string) error

ClearStale unmounts a block that no live session holds, and returns ErrRunning when one does. A block without a lock file came from a version before the lock and counts as stale.

func Hold

func Hold(gameDir string) (*os.File, error)

Hold marks a session live in the installation at gameDir until the returned file closes or the process exits, however it exits. Hold before mounting and close after unmounting. Several sessions may hold at once.

func Mount

func Mount(gameDir, key string) error

Mount adds the session's block for the package named key to the installation's gameinfo.gi, replacing a block a session left that did not end cleanly or that names an older package.

func PackagePath added in v0.1.33

func PackagePath(gameDir, key string) string

PackagePath returns the directory of the package named key in the installation at gameDir.

func Path

func Path(gameDir string) string

Path returns the sessions' directory in the installation at gameDir.

func Prune added in v0.1.33

func Prune(gameDir, keep string) error

Prune removes every package but keep's while no other session is live, and keeps going past an entry it cannot remove, such as a package a running game still holds. Prune before Hold, whose shared lock would count as live.

func Unmount

func Unmount(gameDir string) error

Unmount removes the session's block from the installation's gameinfo.gi, as it reads now, keeping every change another program made since.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL