5.5.4. - The Settings File
The settings file is a binary file that contains consecutive data for each motor according to the following structure:
struct sav_mot {
long sm_pos; /* Current dial position */
float sm_off; /* Current user/dial offset */
double sm_low; /* Software low limit */
double sm_high; /* Software high limit */
};
The
settings
file must have write permission for everybody who runs spec,
as it is
updated every time someone
moves a motor or changes an offset or limit.
When spec starts out, it checks to see if there is
a
settings
file and creates an empty one if there isn't.
spec creates a software lock on the
settings
file using the
lockf()
library call.
The lock prevents another instance of spec opening the file for writing.
