changeset 9647:0ff0c86afbe4 octave-forge

temp_name: deprecating function in favour of tmpnam
author carandraug
date Mon, 12 Mar 2012 18:31:51 +0000
parents 3250035e724f
children ff2c3baffb69
files main/miscellaneous/NEWS main/miscellaneous/inst/temp_name.m
diffstat 2 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/main/miscellaneous/NEWS	Mon Mar 12 18:16:27 2012 +0000
+++ b/main/miscellaneous/NEWS	Mon Mar 12 18:31:51 2012 +0000
@@ -25,6 +25,9 @@
  ** The function `partarray' has been deprecated. `mat2cell' from octave core
     should be used instead.
 
+ ** The function `temp_name' has been deprecated. `tmpnam' from octave core
+    should be used instead.
+
  ** Multiple bug fixes and increased input check on many functions.
 
  ** The function `csv2cell' now returns an empty cell in the case of empty file
--- a/main/miscellaneous/inst/temp_name.m	Mon Mar 12 18:16:27 2012 +0000
+++ b/main/miscellaneous/inst/temp_name.m	Mon Mar 12 18:31:51 2012 +0000
@@ -33,6 +33,13 @@
 
 function n = temp_name (rootname, quick)
 
+  persistent warned = false;
+  if (! warned)
+    warned = true;
+    warning ("Octave:deprecated-function",
+             "temp_name has been deprecated, and will be removed in the future. Use `tmpnam' instead.");
+  endif
+
   ### Keep track of previously asked names
   persistent cnt = struct ("dummy",0);