comparison src/file-io.cc @ 5109:1e36493572a0

[project @ 2005-01-18 20:17:53 by jwe]
author jwe
date Tue, 18 Jan 2005 20:17:53 +0000
parents b04b30d30c66
children 25b090e1be9f
comparison
equal deleted inserted replaced
5108:10004c9625c3 5109:1e36493572a0
1795 return retval; 1795 return retval;
1796 } 1796 }
1797 1797
1798 DEFUN (mkstemp, args, , 1798 DEFUN (mkstemp, args, ,
1799 "-*- texinfo -*-\n\ 1799 "-*- texinfo -*-\n\
1800 @deftypefn {Built-in Function} {[@var{fid}, @var{name}, @var{msg}] =} tmpfile (@var{template}, @var{delete})\n\ 1800 @deftypefn {Built-in Function} {[@var{fid}, @var{name}, @var{msg}] =} mkstemp (@var{template}, @var{delete})\n\
1801 Return the file ID corresponding to a new temporary file with a unique\n\ 1801 Return the file ID corresponding to a new temporary file with a unique\n\
1802 name created from @var{template}. The last six characters of @var{template}\n\ 1802 name created from @var{template}. The last six characters of @var{template}\n\
1803 must be @code{XXXXXX} and these are replaced with a string that makes the\n\ 1803 must be @code{XXXXXX} and these are replaced with a string that makes the\n\
1804 filename unique. The file is then created with mode read/write and\n\ 1804 filename unique. The file is then created with mode read/write and\n\
1805 permissions that are system dependent (on GNU/Linux systems, the permissions\n\ 1805 permissions that are system dependent (on GNU/Linux systems, the permissions\n\
1839 int fd = mkstemp (tmp); 1839 int fd = mkstemp (tmp);
1840 1840
1841 if (fd < 0) 1841 if (fd < 0)
1842 { 1842 {
1843 using namespace std; 1843 using namespace std;
1844 retval(1) = ::strerror (errno); 1844 retval(2) = ::strerror (errno);
1845 retval(0) = fd; 1845 retval(0) = fd;
1846 } 1846 }
1847 else 1847 else
1848 { 1848 {
1849 const char *fopen_mode = "w+"; 1849 const char *fopen_mode = "w+";
1870 error ("mkstemp: failed to create octave_stdiostream object"); 1870 error ("mkstemp: failed to create octave_stdiostream object");
1871 } 1871 }
1872 else 1872 else
1873 { 1873 {
1874 using namespace std; 1874 using namespace std;
1875 retval(1) = ::strerror (errno); 1875 retval(2) = ::strerror (errno);
1876 retval(0) = -1; 1876 retval(0) = -1;
1877 } 1877 }
1878 } 1878 }
1879 } 1879 }
1880 else 1880 else