CheckPath.m: give more informative error message when trying to create a subdirectory, when a file with the same name already exists

git-svn-id: https://www.dynare.org/svn/dynare/trunk@3037 ac1d8469-bf42-47a9-8791-bf33cf982152
time-shift
sebastien 2009-10-12 16:32:10 +00:00
parent 80b1e63cdc
commit 5f247b32c4
1 changed files with 8 additions and 2 deletions

View File

@ -32,9 +32,15 @@ global M_
DirectoryName = [ M_.dname '/' type ];
if ~isdir(M_.dname)
mkdir('.', M_.dname);
if exist(M_.dname, 'file')
error(['Can''t create subdirectory. You should erase the following file: ' M_.dname])
end
mkdir('.', M_.dname);
end
if ~isdir(DirectoryName)
if exist(DirectoryName, 'file')
error(['Can''t create subdirectory. You should erase the following file: ' DirectoryName])
end
mkdir('.',DirectoryName);
end
end