Documentation
¶
Overview ¶
Package portable keeps the data of a portable copy of SSHYard beside its executable, in sshyard_data, in place of the user's application data, and moves it between the two.
The folder is the switch: a copy whose executable has sshyard_data beside it keeps its data there. A move is asked for while the app runs (Request) and made by the next launch (Apply), before anything opens a file of the data.
Index ¶
Constants ¶
const Dir = "sshyard_data"
Dir is the folder beside the executable that holds a portable copy's data.
Variables ¶
var ( // ErrOccupied is a destination that already holds data. ErrOccupied = errors.New("portable: destination already holds data") // ErrBusy is data that another running copy uses. ErrBusy = errors.New("portable: data in use") )
Functions ¶
func Apply ¶
Apply makes the move Request asked for, between appData, the user's application data folder of the app, and the folder beside the executable in exeDir; it waits up to wait for the copy that asked to quit. A move is whole or not at all: on an error the data stays where it was. The request is answered either way.
func Move ¶
Move moves the data folder src to dst, which must hold no data, waiting up to wait for a copy that uses src to quit. It copies src beside dst and renames the copy into place, then takes src away; on an error dst is gone again and src is as it was. A missing src moves as an empty folder.
Types ¶
This section is empty.