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 ¶
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
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.