Commit d2ddbc2b authored by Houtan Bastani's avatar Houtan Bastani

suppress output from mkdir in octave, check for ‘dir’ instead of ‘file’

parent 0926fe06
Pipeline #1704 passed with stage
in 54 seconds
......@@ -39,8 +39,8 @@ if ne < 1
return
end
if exist([rep_dir filesep o.graphDirName], 'file') ~= 7
mkdir([rep_dir filesep o.graphDirName])
if exist([rep_dir filesep o.graphDirName], 'dir') ~= 7
mkdir([rep_dir filesep o.graphDirName]);
end
if isempty(o.graphName)
graphName = sprintf([o.graphDirName filesep 'graph_pg%d_sec%d_row%d_col%d.tex'], pg, sec, row, col);
......
......@@ -42,12 +42,9 @@ end
fprintf(fid, '\n');
if ~isempty(o.latex)
if ~exist(o.pageDirName, 'dir')
mkdir(o.pageDirName)
end
dir = [rep_dir filesep o.pageDirName];
if exist(dir, 'file') ~= 7
mkdir(dir)
if exist(dir, 'dir') ~= 7
mkdir(dir);
end
pagename = [dir filesep 'page_' num2str(pg) '.tex'];
[fidp, msg] = fopen(pagename, 'w');
......
......@@ -28,8 +28,8 @@ function o = write(o)
% You should have received a copy of the GNU General Public License
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
if exist(o.directory, 'file') ~= 7
mkdir(o.directory)
if exist(o.directory, 'dir') ~= 7
mkdir(o.directory);
end
[fid, msg] = fopen([o.directory filesep o.fileName], 'w');
if fid == -1
......
......@@ -40,8 +40,8 @@ if ne == 0 && ~is_data_table
return
end
if exist([rep_dir filesep o.tableDirName], 'file') ~= 7
mkdir([rep_dir filesep o.tableDirName])
if exist([rep_dir filesep o.tableDirName], 'dir') ~= 7
mkdir([rep_dir filesep o.tableDirName]);
end
if isempty(o.tableName)
tableName = sprintf([o.tableDirName filesep 'table_pg%d_sec%d_row%d_col%d.tex'], pg, sec, row, col);
......
Markdown is supported
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