replace `filesep` with `/`
On Windows, `filesep` evaluates to `\` and, in a `*printf` statement, this can have unintended consequences (e.g. `\t` evaluates to the tab character Since '/' works on all systems, replace all occurrences of `filesep` with `/` in the codebaseremove-priordens
parent
09b59aa321
commit
388f92b607
|
@ -39,16 +39,16 @@ if ne < 1
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
if exist([rep_dir filesep o.graphDirName], 'dir') ~= 7
|
if exist([rep_dir '/' o.graphDirName], 'dir') ~= 7
|
||||||
mkdir([rep_dir filesep o.graphDirName]);
|
mkdir([rep_dir '/' 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 '/graph_pg%d_sec%d_row%d_col%d.tex'], pg, sec, row, col);
|
||||||
else
|
else
|
||||||
graphName = [o.graphDirName filesep o.graphName];
|
graphName = [o.graphDirName '/' o.graphName];
|
||||||
end
|
end
|
||||||
|
|
||||||
[fid, msg] = fopen([rep_dir filesep graphName], 'w');
|
[fid, msg] = fopen([rep_dir '/' graphName], 'w');
|
||||||
if fid == -1
|
if fid == -1
|
||||||
error(['@graph.writeGraphFile: ' msg]);
|
error(['@graph.writeGraphFile: ' msg]);
|
||||||
end
|
end
|
||||||
|
|
|
@ -42,11 +42,11 @@ end
|
||||||
fprintf(fid, '\n');
|
fprintf(fid, '\n');
|
||||||
|
|
||||||
if ~isempty(o.latex)
|
if ~isempty(o.latex)
|
||||||
dir = [rep_dir filesep o.pageDirName];
|
dir = [rep_dir '/' o.pageDirName];
|
||||||
if exist(dir, 'dir') ~= 7
|
if exist(dir, 'dir') ~= 7
|
||||||
mkdir(dir);
|
mkdir(dir);
|
||||||
end
|
end
|
||||||
pagename = [dir filesep 'page_' num2str(pg) '.tex'];
|
pagename = [dir '/page_' num2str(pg) '.tex'];
|
||||||
[fidp, msg] = fopen(pagename, 'w');
|
[fidp, msg] = fopen(pagename, 'w');
|
||||||
if fidp == -1
|
if fidp == -1
|
||||||
error(['@page.write: ' msg]);
|
error(['@page.write: ' msg]);
|
||||||
|
|
|
@ -57,7 +57,7 @@ assert(ischar(opts.compiler), '@report.compile: compiler file must be a string')
|
||||||
assert(islogical(opts.showReport), '@report.compile: showReport must be either true or false');
|
assert(islogical(opts.showReport), '@report.compile: showReport must be either true or false');
|
||||||
assert(islogical(opts.showOutput), '@report.compile: showOutput must be either true or false');
|
assert(islogical(opts.showOutput), '@report.compile: showOutput must be either true or false');
|
||||||
|
|
||||||
if exist([o.directory filesep o.fileName], 'file') ~= 2
|
if exist([o.directory '/' o.fileName], 'file') ~= 2
|
||||||
o.write();
|
o.write();
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -111,7 +111,7 @@ if status ~= 0
|
||||||
' ' opts.compiler ' returned the error code: ' num2str(status)]);
|
' ' opts.compiler ' returned the error code: ' num2str(status)]);
|
||||||
end
|
end
|
||||||
if o.showOutput || opts.showOutput
|
if o.showOutput || opts.showOutput
|
||||||
fprintf('Done.\n\nYour compiled report is located here:\n %s.pdf\n\n\n', [pwd filesep rfn])
|
fprintf('Done.\n\nYour compiled report is located here:\n %s.pdf\n\n\n', [pwd '/' rfn])
|
||||||
end
|
end
|
||||||
if opts.showReport && ~isoctave
|
if opts.showReport && ~isoctave
|
||||||
open([rfn '.pdf']);
|
open([rfn '.pdf']);
|
||||||
|
|
|
@ -31,7 +31,7 @@ function o = write(o)
|
||||||
if exist(o.directory, 'dir') ~= 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 '/' o.fileName], 'w');
|
||||||
if fid == -1
|
if fid == -1
|
||||||
error(['@report.write: ' msg]);
|
error(['@report.write: ' msg]);
|
||||||
end
|
end
|
||||||
|
|
|
@ -40,16 +40,16 @@ if ne == 0 && ~is_data_table
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
if exist([rep_dir filesep o.tableDirName], 'dir') ~= 7
|
if exist([rep_dir '/' o.tableDirName], 'dir') ~= 7
|
||||||
mkdir([rep_dir filesep o.tableDirName]);
|
mkdir([rep_dir '/' 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 '/table_pg%d_sec%d_row%d_col%d.tex'], pg, sec, row, col);
|
||||||
else
|
else
|
||||||
tableName = [o.tableDirName filesep o.tableName];
|
tableName = [o.tableDirName '/' o.tableName];
|
||||||
end
|
end
|
||||||
|
|
||||||
[fid, msg] = fopen([rep_dir filesep tableName], 'w');
|
[fid, msg] = fopen([rep_dir '/' tableName], 'w');
|
||||||
if fid == -1
|
if fid == -1
|
||||||
error(['@report_table.writeTableFile: ' msg]);
|
error(['@report_table.writeTableFile: ' msg]);
|
||||||
end
|
end
|
||||||
|
|
|
@ -24,5 +24,5 @@ function initialize_reporting_toolbox()
|
||||||
reporting_src_root = strrep(which('initialize_reporting_toolbox'), 'initialize_reporting_toolbox.m', '');
|
reporting_src_root = strrep(which('initialize_reporting_toolbox'), 'initialize_reporting_toolbox.m', '');
|
||||||
|
|
||||||
% Add path to reporting source
|
% Add path to reporting source
|
||||||
addpath([reporting_src_root filesep '..' filesep 'macros']);
|
addpath([reporting_src_root '/../macros']);
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue