From 8c9ca5736a096d6cb850e1df12195102532637cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Adjemian=20=28Scylla=29?= <stephane.adjemian@univ-lemans.fr> Date: Fri, 13 Dec 2013 15:47:56 +0100 Subject: [PATCH] Add a second output argument to CheckPath nonzero iff the routine creates a new directory. (cherry picked from commit fd5742a399dca1a125e170123d2125b77e8f5b2a) --- matlab/CheckPath.m | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/matlab/CheckPath.m b/matlab/CheckPath.m index 7e6c89f81..c83005513 100644 --- a/matlab/CheckPath.m +++ b/matlab/CheckPath.m @@ -1,4 +1,4 @@ -function DirectoryName = CheckPath(type,dname) +function [DirectoryName, info] = CheckPath(type,dname) % Creates the subfolder "./M_.dname/type" if it does not exist yet. % % INPUTS @@ -6,12 +6,13 @@ function DirectoryName = CheckPath(type,dname) % dname [string] Name of the directory % % OUTPUTS -% none. +% DirectoryName string, name of the directory (with path). +% info integer scalar, equal to 1 if the routine creates directory dname/type, zero otherwise. % % SPECIAL REQUIREMENTS % none -% Copyright (C) 2005-2012 Dynare Team +% Copyright (C) 2005-2013 Dynare Team % % This file is part of Dynare. % @@ -28,6 +29,8 @@ function DirectoryName = CheckPath(type,dname) % You should have received a copy of the GNU General Public License % along with Dynare. If not, see <http://www.gnu.org/licenses/>. +info = 0; + DirectoryName = [ dname '/' type ]; if ~isdir(dname) @@ -44,4 +47,5 @@ if ~isdir(DirectoryName) delete(DirectoryName) end mkdir('.',DirectoryName); + info = 1; end -- GitLab