Mercurial > hg > octave-nkf
annotate scripts/deprecated/octave_tmp_file_name.m @ 20279:db30302bedc3
Added tag rc-4-0-0-3 for changeset 065f933ef083
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Fri, 10 Apr 2015 14:41:21 -0400 |
parents | 4197fc428c7d |
children |
rev | line source |
---|---|
19898
4197fc428c7d
maint: Update copyright notices for 2015.
John W. Eaton <jwe@octave.org>
parents:
19842
diff
changeset
|
1 ## Copyright (C) 2014-2015 John W. Eaton |
19460 | 2 ## |
3 ## This file is part of Octave. | |
4 ## | |
5 ## Octave is free software; you can redistribute it and/or modify it | |
6 ## under the terms of the GNU General Public License as published by | |
7 ## the Free Software Foundation; either version 3 of the License, or (at | |
8 ## your option) any later version. | |
9 ## | |
10 ## Octave is distributed in the hope that it will be useful, but | |
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
13 ## General Public License for more details. | |
14 ## | |
15 ## You should have received a copy of the GNU General Public License | |
16 ## along with Octave; see the file COPYING. If not, see | |
17 ## <http://www.gnu.org/licenses/>. | |
18 | |
19 ## -*- texinfo -*- | |
20 ## @deftypefn {Built-in Function} {@var{fname} =} octave_tmp_file_name () | |
21 ## @deftypefnx {Built-in Function} {@var{fname} =} octave_tmp_file_name (@var{dir}) | |
22 ## @deftypefnx {Built-in Function} {@var{fname} =} octave_tmp_file_name (@var{dir}, @var{prefix}) | |
23 ## | |
24 ## @code{octave_tmp_file_name} is deprecated and will be removed in Octave | |
19842
ebd27d8c63fd
update default branch to release as 4.0
John W. Eaton <jwe@octave.org>
parents:
19794
diff
changeset
|
25 ## version 4.4. Use @code{tempname} for equivalent functionality. |
19460 | 26 ## |
27 ## Return a unique temporary file name as a string. | |
19794
db92e7e28e1f
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
19460
diff
changeset
|
28 ## |
19460 | 29 ## If @var{prefix} is omitted, a value of @qcode{"oct-"} is used. |
30 ## If @var{dir} is also omitted, the default directory for temporary files | |
31 ## (@code{P_tmpdir} is used. If @var{dir} is provided, it must exist, | |
32 ## otherwise the default directory for temporary files is used. | |
33 ## @seealso{tempname, tmpnam, mkstemp, tempdir, P_tmpdir, tmpfile} | |
34 ## @end deftypefn | |
35 | |
19842
ebd27d8c63fd
update default branch to release as 4.0
John W. Eaton <jwe@octave.org>
parents:
19794
diff
changeset
|
36 ## Deprecated in version 4.0 |
19460 | 37 |
38 function filename = octave_tmp_file_name (varargin) | |
39 | |
40 persistent warned = false; | |
41 if (! warned) | |
42 warned = true; | |
43 warning ("Octave:deprecated-function", | |
44 "octave_tmp_file_name is obsolete and will be removed from a future version of Octave, please use tempname instead"); | |
45 endif | |
46 | |
47 filename = tmpnam (varargin{:}); | |
48 | |
49 endfunction | |
50 | |
51 | |
52 %!assert (1) | |
53 |