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-bf33cf982152time-shift
parent
80b1e63cdc
commit
5f247b32c4
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue