SDT-base         Contents     Functions         Previous Next     PDF Index

sd_pref

Purpose

Safe MATLAB preferences handling.

Syntax

sd_pref('set','Group','Pref','val');  % setpref
flag=sd_pref('get','Group','Pref');   % getpref
i1=sd_pref('is','Group');             % ispref
sd_pref('rm','Group','Pref');         % rmpref

Description

MATLAB, and MCR, have known issues of preference file corruption if accessed by several instances at once. To avoid this issue sd_pref implements a safe access strategy using fjlock .

The syntax is equivalent to usual MATLAB *pref commands, the additional first argument provides the function prefix to be used.

It is possible in rare cases that a MATLAB crashes during the procedure, leaving an active lock on the preferences file. The user will be warned in such case, and will be invited to use command sd_pref('ForceUnlock') to resolve the issue. Note that if one used under Unix the lock type 1, restarting the OS may be necessary, see fjlock for more information.


©1991-2024 by SDTools
Previous Up Next