paths

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2020 License: GPL-3.0, GPL-3.0 Imports: 2 Imported by: 0

Documentation

Overview

Package paths contains functions to prepare paths for gopher2600 resources.

The ResourcePath() function returns the correct path to the resource directory/file specified in the arguments. The result of ResourcePath depends on the build tag used to compile the program.

For "release" tagged builds, the correct path is one rooted in the user's configuration directory. On modern Linux systems the full path would be something like:

/home/user/.config/gopher2600/

For "non-release" tagged builds, the correct path is rooted in the current working directory:

.gopher2600

The reason for this is simple. During development, it is more convenient to have the config directory close to hand. For release binaries meanwhile, the config directory should be somewhere the user expects.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ResourcePath

func ResourcePath(subPth string, file string) (string, error)

ResourcePath returns the resource string (representing the resource to be loaded) prepended with OS/build specific paths.

The function takes care of creation of all folders necessary to reach the end of sub-path. It does not otherwise touch or create the file.

Either subPth or file can be empty, depending on context.

Types

This section is empty.

Jump to

Keyboard shortcuts

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