unique

package
v0.30.0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

Package unique contains functions that compose filenames that should be unique on the filesystem.

This is useful in other Gopher2600 packages. For example, it used to generate filenames for: playback recordings, regression scripts and many other file types.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Filename

func Filename(filetype string, cartname string) string

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

Format of returned string is:

filetype_cartname_YYYYMMDD_HHMMSS

Where cartname is the string returned by cartload.ShortName(). If the cartname argument is empty the returned string will be of the format:

filetype_YYYYMMDD_HHMMSS

The filetype argument is simply another way of identifying the file uniquely. For example, if saving a screenshot the filetype might simply be "screenshot" or "photo".

If the filetype argument is empty the returned string will be of the format:

cartname_YYYYMMDD_HHMMSS

If both filetype and cartname arguments are empty then the returned string will be the timestamp only.

Note that there is no provision for adding a file extension. If you need one you must append that manually.

Types

This section is empty.

Jump to

Keyboard shortcuts

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