Mercurial > hg > octave-shane
changeset 2936:87cb7614257d
[project @ 1997-05-06 05:46:00 by jwe]
author | jwe |
---|---|
date | Tue, 06 May 1997 05:46:00 +0000 |
parents | a57fdc645b1f |
children | 9d26524e2869 |
files | src/file-io.cc src/oct-hist.cc src/pt-plot.cc |
diffstat | 3 files changed, 13 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/src/file-io.cc +++ b/src/file-io.cc @@ -1274,13 +1274,21 @@ } DEFUN (tmpnam, args, , - "tmpnam ()\n\ + "tmpnam (DIR, PREFIX)\n\ Return unique temporary file name.") { octave_value retval; - if (args.length () == 0) - retval = file_ops::tempnam (); + int len = args.length (); + + if (len < 3) + { + string dir = len > 0 ? args(0).string_value () : string (); + string pfx = len > 1 ? args(1).string_value () : string ("oct-"); + + if (! error_state) + retval = file_ops::tempnam (dir, pfx); + } else print_usage ("tmpnam");