Mercurial > octave-nkf
comparison src/file-io.cc @ 5333:ac8d64b9e76a
[project @ 2005-05-02 18:15:20 by jwe]
author | jwe |
---|---|
date | Mon, 02 May 2005 18:16:51 +0000 |
parents | ecbe4aa87e51 |
children | df230b7df93c |
comparison
equal
deleted
inserted
replaced
5332:15db952ced2e | 5333:ac8d64b9e76a |
---|---|
1749 is used. If @var{dir} is provided, it must exist, otherwise the default\n\ | 1749 is used. If @var{dir} is provided, it must exist, otherwise the default\n\ |
1750 directory for temporary files is used. Since the named file is not\n\ | 1750 directory for temporary files is used. Since the named file is not\n\ |
1751 opened, by @code{tmpnam}, it is possible (though relatively unlikely)\n\ | 1751 opened, by @code{tmpnam}, it is possible (though relatively unlikely)\n\ |
1752 that it will not be available by the time your program attempts to open it.\n\ | 1752 that it will not be available by the time your program attempts to open it.\n\ |
1753 @end deftypefn\n\ | 1753 @end deftypefn\n\ |
1754 @seealso{tmpfile, mkstemp, and P_tmpdir}") | 1754 @seealso{tmpfile, mkstemp, P_tmpdir}") |
1755 { | 1755 { |
1756 octave_value retval; | 1756 octave_value retval; |
1757 | 1757 |
1758 int len = args.length (); | 1758 int len = args.length (); |
1759 | 1759 |
1792 \n\ | 1792 \n\ |
1793 If successful, @var{fid} is a valid file ID and @var{msg} is an empty\n\ | 1793 If successful, @var{fid} is a valid file ID and @var{msg} is an empty\n\ |
1794 string. Otherwise, @var{fid} is -1 and @var{msg} contains a\n\ | 1794 string. Otherwise, @var{fid} is -1 and @var{msg} contains a\n\ |
1795 system-dependent error message.\n\ | 1795 system-dependent error message.\n\ |
1796 @end deftypefn\n\ | 1796 @end deftypefn\n\ |
1797 @seealso{tmpnam, mkstemp, and P_tmpdir}") | 1797 @seealso{tmpnam, mkstemp, P_tmpdir}") |
1798 { | 1798 { |
1799 octave_value_list retval; | 1799 octave_value_list retval; |
1800 | 1800 |
1801 retval(1) = std::string (); | 1801 retval(1) = std::string (); |
1802 retval(0) = -1; | 1802 retval(0) = -1; |
1852 If successful, @var{fid} is a valid file ID, @var{name} is the name of\n\ | 1852 If successful, @var{fid} is a valid file ID, @var{name} is the name of\n\ |
1853 the file, and and @var{msg} is an empty string. Otherwise, @var{fid}\n\ | 1853 the file, and and @var{msg} is an empty string. Otherwise, @var{fid}\n\ |
1854 is -1, @var{name} is empty, and @var{msg} contains a system-dependent\n\ | 1854 is -1, @var{name} is empty, and @var{msg} contains a system-dependent\n\ |
1855 error message.\n\ | 1855 error message.\n\ |
1856 @end deftypefn\n\ | 1856 @end deftypefn\n\ |
1857 @seealso{tmpfile, tmpnam, and P_tmpdir}") | 1857 @seealso{tmpfile, tmpnam, P_tmpdir}") |
1858 { | 1858 { |
1859 octave_value_list retval; | 1859 octave_value_list retval; |
1860 | 1860 |
1861 retval(2) = std::string (); | 1861 retval(2) = std::string (); |
1862 retval(1) = std::string (); | 1862 retval(1) = std::string (); |
2012 #define P_tmpdir "/tmp" | 2012 #define P_tmpdir "/tmp" |
2013 #endif | 2013 #endif |
2014 | 2014 |
2015 DEFCONSTX ("P_tmpdir", SBV_P_tmpdir, P_tmpdir, | 2015 DEFCONSTX ("P_tmpdir", SBV_P_tmpdir, P_tmpdir, |
2016 "-*- texinfo -*-\n\ | 2016 "-*- texinfo -*-\n\ |
2017 @defvr {Built-in Variable} P_tmpdir\n\ | 2017 @defvr {Built-in Constant} P_tmpdir\n\ |
2018 The default name of the directory for temporary files on this system.\n\ | 2018 The default name of the directory for temporary files on this system.\n\ |
2019 The value of this variable is system dependent.\n\ | 2019 The value of this variable is system dependent.\n\ |
2020 @end defvr"); | 2020 @end defvr"); |
2021 | 2021 |
2022 // NOTE: the values of SEEK_SET, SEEK_CUR, and SEEK_END have to be | 2022 // NOTE: the values of SEEK_SET, SEEK_CUR, and SEEK_END have to be |
2023 // this way for Matlab compatibility. | 2023 // this way for Matlab compatibility. |
2024 | 2024 |
2025 DEFCONSTX ("SEEK_SET", SBV_SEEK_SET, -1, | 2025 DEFCONSTX ("SEEK_SET", SBV_SEEK_SET, -1, |
2026 "-*- texinfo -*-\n\ | 2026 "-*- texinfo -*-\n\ |
2027 @defvr {Built-in Variable} SEEK_SET\n\ | 2027 @defvr {Built-in Constant} SEEK_SET\n\ |
2028 @defvrx {Built-in Variable} SEEK_CUR\n\ | 2028 @defvrx {Built-in Constant} SEEK_CUR\n\ |
2029 @defvrx {Built-in Variable} SEEK_END\n\ | 2029 @defvrx {Built-in Constant} SEEK_END\n\ |
2030 These variables may be used as the optional third argument for the\n\ | 2030 These variables may be used as the optional third argument for the\n\ |
2031 function @code{fseek}.\n\ | 2031 function @code{fseek}.\n\ |
2032 \n\ | 2032 \n\ |
2033 @table @code\n\ | 2033 @table @code\n\ |
2034 @item SEEK_SET\n\ | 2034 @item SEEK_SET\n\ |
2042 @end table\n\ | 2042 @end table\n\ |
2043 @end defvr"); | 2043 @end defvr"); |
2044 | 2044 |
2045 DEFCONSTX ("SEEK_CUR", SBV_SEEK_CUR, 0, | 2045 DEFCONSTX ("SEEK_CUR", SBV_SEEK_CUR, 0, |
2046 "-*- texinfo -*-\n\ | 2046 "-*- texinfo -*-\n\ |
2047 @defvr {Built-in Variable} SEEK_CUR\n\ | 2047 @defvr {Built-in Constant} SEEK_CUR\n\ |
2048 See SEEK_SET.\n\ | 2048 See SEEK_SET.\n\ |
2049 @end defvr"); | 2049 @end defvr"); |
2050 | 2050 |
2051 DEFCONSTX ("SEEK_END", SBV_SEEK_END, 1, | 2051 DEFCONSTX ("SEEK_END", SBV_SEEK_END, 1, |
2052 "-*- texinfo -*-\n\ | 2052 "-*- texinfo -*-\n\ |
2053 @defvr {Built-in Variable} SEEK_END\n\ | 2053 @defvr {Built-in Constant} SEEK_END\n\ |
2054 See SEEK_SET.\n\ | 2054 See SEEK_SET.\n\ |
2055 @end defvr"); | 2055 @end defvr"); |
2056 | 2056 |
2057 DEFCONSTX ("stdin", SBV_stdin, stdin_file, | 2057 DEFCONSTX ("stdin", SBV_stdin, stdin_file, |
2058 "-*- texinfo -*-\n\ | 2058 "-*- texinfo -*-\n\ |
2059 @defvr {Built-in Variable} stdin\n\ | 2059 @defvr {Built-in Constant} stdin\n\ |
2060 The standard input stream (file id 0). When Octave is used\n\ | 2060 The standard input stream (file id 0). When Octave is used\n\ |
2061 interactively, this is filtered through the command line editing\n\ | 2061 interactively, this is filtered through the command line editing\n\ |
2062 functions.\n\ | 2062 functions.\n\ |
2063 @seealso{stdout, stderr}\n\ | |
2063 @end defvr"); | 2064 @end defvr"); |
2064 | 2065 |
2065 DEFCONSTX ("stdout", SBV_stdout, stdout_file, | 2066 DEFCONSTX ("stdout", SBV_stdout, stdout_file, |
2066 "-*- texinfo -*-\n\ | 2067 "-*- texinfo -*-\n\ |
2067 @defvr {Built-in Variable} stdout\n\ | 2068 @defvr {Built-in Constant} stdout\n\ |
2068 The standard output stream (file id 1). Data written to the\n\ | 2069 The standard output stream (file id 1). Data written to the\n\ |
2069 standard output is normally filtered through the pager.\n\ | 2070 standard output is normally filtered through the pager.\n\ |
2071 @seealso{stdin, stderr}\n\ | |
2070 @end defvr"); | 2072 @end defvr"); |
2071 | 2073 |
2072 DEFCONSTX ("stderr", SBV_stderr, stderr_file, | 2074 DEFCONSTX ("stderr", SBV_stderr, stderr_file, |
2073 "-*- texinfo -*-\n\ | 2075 "-*- texinfo -*-\n\ |
2074 @defvr {Built-in Variable} stderr\n\ | 2076 @defvr {Built-in Constant} stderr\n\ |
2075 The standard error stream (file id 2). Even if paging is turned on,\n\ | 2077 The standard error stream (file id 2). Even if paging is turned on,\n\ |
2076 the standard error is not sent to the pager. It is useful for error\n\ | 2078 the standard error is not sent to the pager. It is useful for error\n\ |
2077 messages and prompts.\n\ | 2079 messages and prompts.\n\ |
2080 @seealso{stdin, stdout}\n\ | |
2078 @end defvr"); | 2081 @end defvr"); |
2079 | 2082 |
2080 } | 2083 } |
2081 | 2084 |
2082 /* | 2085 /* |