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