paths

package
v0.14.1 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2021 License: GPL-3.0, GPL-3.0 Imports: 6 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.

func UniqueFilename added in v0.10.1

func UniqueFilename(prepend string, shortCartName string) string

UniqueFilename creates a filename that (assuming a functioning clock) should not collide with any existing file. Note that the function does not test for this.

Used to generate filenames for:

  • playback recordings
  • regression scripts
  • terminal output (sdlimgui GUI)

Format of returned string is:

prepend_cartname_YYYYMMDD_HHMMSS

Where cartname is the string returned by cartload.ShortName(). If there is no cartridge name the returned string will be of the format:

prepend_YYYYMMDD_HHMMSS

Types

This section is empty.

Directories

Path Synopsis
Package fs is an abstraction for OS/filesystem functions that may be missing or require special handling.
Package fs is an abstraction for OS/filesystem functions that may be missing or require special handling.

Jump to

Keyboard shortcuts

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