Commit cda5eec3 authored by Stéphane Adjemian's avatar Stéphane Adjemian
Browse files

Added method for deleting generated files.

Only useful if x13 fails (otherwise the files are deleted).
parent f5abad05
function clean(o)
% Erase generated files if any.
% Copyright (C) 2017 Dynare Team
%
% This code is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% (at your option) any later version.
%
% Dynare dates submodule is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
if ~isempty(o.results)
basename = o.results.name;
delete(sprintf('%s.*', basename))
end
\ No newline at end of file
......@@ -48,7 +48,7 @@ switch S(1).type
error('x13:%s: Wrong calling sequence!', S(1).subs)
end
end
case {'print', 'run'}
case {'print', 'run', 'clean'}
if isequal(length(S), 1)
feval(S(1).subs, o);
elseif isequal(length(S), 2)
......@@ -65,6 +65,7 @@ switch S(1).type
error('x13:: I expect no more than two input arguments!')
end
case 'results'
% Returns a structure with all the results.
o = o.results;
otherwise
error('x13:: I do not understand what you are asking for!')
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment