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