[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #48221] prefdir should not be a private functi
From: |
Guillaume |
Subject: |
[Octave-bug-tracker] [bug #48221] prefdir should not be a private function |
Date: |
Wed, 15 Jun 2016 09:37:55 +0000 (UTC) |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:46.0) Gecko/20100101 Firefox/46.0 |
Follow-up Comment #5, bug #48221 (project octave):
Sorry, there was a typo - new version below:
## -*- texinfo -*-
## @deftypefn {} {} prefdir
## @deftypefnx {} address@hidden =} prefdir
## @deftypefnx {} address@hidden =} prefdir (1)
## Return the name of the directory containing Octave's preferences.
##
## @var{D} is a string containing the name of the directory containing
## Octave's preferences. The directory may or may not exist.
##
## If 1 is provided as an input, the preference directory is created if
## it does not yet exist.
##
## @seealso{addpref, getpref, setpref, ispref, rmpref}
## @end deftypefn
function retval = prefdir (varargin)
if (ispc ())
d = fullfile ('AppData', 'Roaming', 'Octave'); % or Documents\Octave
else
d = '.octave';
endif
retval = fullfile (get_home_directory (), d, version ());
if (nargin ~= 0)
if ((isnumeric (varargin{1}) || islogical (varargin{1})) && ...
numel (varargin{1}) == 1)
if (logical (varargin{1}) && ~exist (retval, 'dir'))
mkdir (retval);
endif
else
error ('Input must be 1 to create the preference directory.');
endif
endif
endfunction
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?48221>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/