Mercurial > octave-nkf
diff scripts/io/textscan.m @ 19312:6ca096827123
Use tempname() rather than tmpnam() in core Octave.
* scripts/miscellaneous/tempname.m: Removed m-file as function is now C++.
* scripts/miscellaneous/tmpnam.m: New m-file is an alias that calls tempname.
* scripts/miscellaneous/module.mk: Add tmpnam.m to build system.
* io.txi: Place tempname, tempdir, P_tmpdir docstrings in section on temporary
files.
* system.txi: Remove tempname, tempdir, P_tmpdir docstrings from generic
system functions section of manual.
* dirfns.cc, dlmread.cc, md5sum.cc, ov-fcn-handle.cc: Replace instances
of tmpnam with tempname in BIST code.
* file-io.cc (Ftempname): Change DEFUNX for tmpnam to DEFUN for tempname.
Remove seealso links to tmpnam.
* ftp.m, playaudio.m, wavwrite.m, imformats.m, imread.m, imwrite.m, imageIO.m,
csvwrite.m, dlmwrite.m, fileread.m, importdata.m, textread.m, textscan.m,
genvarname.m, unpack.m, install.m, legend.m, __gnuplot_drawnow__.m,
copyobj.m, hgsave.m, print.m, __ghostscript__.m, __gnuplot_get_var__.m,
__gnuplot_ginput__.m, __gnuplot_print__.m: Replace tmpnam with tempname in
core code.
* build-sparse-tests.sh, io.tst, prefer.tst, system.tst: Replace tmpnam with
tempname in test code.
author | Rik <rik@octave.org> |
---|---|
date | Wed, 22 Oct 2014 10:41:15 -0700 |
parents | c573d9c70ae5 |
children | 0e1f5a750d00 |
line wrap: on
line diff
--- a/scripts/io/textscan.m Tue Oct 21 14:37:44 2014 -0400 +++ b/scripts/io/textscan.m Wed Oct 22 10:41:15 2014 -0700 @@ -581,7 +581,7 @@ %% Test reading from a real file %!test -%! f = tmpnam (); +%! f = tempname (); %! fid = fopen (f, "w+"); %! d = rand (1, 4); %! fprintf (fid, " %f %f %f %f ", d); @@ -594,7 +594,7 @@ %% Tests reading with empty format, should return proper nr of columns %!test -%! f = tmpnam (); +%! f = tempname (); %! fid = fopen (f, "w+"); %! fprintf (fid, " 1 2 3 4\n5 6 7 8"); %! fseek (fid, 0, "bof"); @@ -608,7 +608,7 @@ %% Tests reading with empty format; empty fields & incomplete lower row %!test -%! f = tmpnam (); +%! f = tempname (); %! fid = fopen (f, "w+"); %! fprintf (fid, " ,2,,4\n5,6"); %! fseek (fid, 0, "bof"); @@ -620,7 +620,7 @@ %% Error message tests %!test -%! f = tmpnam (); +%! f = tempname (); %! fid = fopen (f, "w+"); %! msg1 = "Missing or illegal value for 'headerlines'"; %! try @@ -631,7 +631,7 @@ %! assert (msg1, lasterr); %!test -%! f = tmpnam (); +%! f = tempname (); %! fid = fopen (f, "w+"); %! msg1 = "Missing or illegal value for 'headerlines'"; %! try @@ -642,7 +642,7 @@ %! assert (msg1, lasterr); %!test -%! f = tmpnam (); +%! f = tempname (); %! fid = fopen (f, "w+"); %! fprintf (fid,"some_string"); %! fseek (fid, 0, "bof"); @@ -655,7 +655,7 @@ %! assert (msg1, lasterr); %!test -%! f = tmpnam (); +%! f = tempname (); %! fid = fopen (f, "w+"); %! fprintf (fid,"some_string"); %! fseek (fid, 0, "bof");