GNU Octave
3.8.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
|
#include <cerrno>
#include <cstdio>
#include <iostream>
#include <limits>
#include <stack>
#include <vector>
#include <fcntl.h>
#include <sys/types.h>
#include <unistd.h>
#include "error.h"
#include "file-ops.h"
#include "file-stat.h"
#include "lo-ieee.h"
#include "oct-env.h"
#include "oct-locbuf.h"
#include "defun.h"
#include "file-io.h"
#include "load-path.h"
#include "oct-fstrm.h"
#include "oct-iostrm.h"
#include "oct-map.h"
#include "oct-obj.h"
#include "oct-prcstrm.h"
#include "oct-stream.h"
#include "oct-strstrm.h"
#include "pager.h"
#include "sysdep.h"
#include "utils.h"
#include "variables.h"
Go to the source code of this file.
Variables | |
static octave_value | stderr_file |
static octave_stream | stderr_stream |
static octave_value | stdin_file |
static octave_stream | stdin_stream |
static octave_value | stdout_file |
static octave_stream | stdout_stream |
std::stack< std::string > | tmp_files |
Definition at line 123 of file file-io.cc.
Referenced by do_octave_atexit().
Definition at line 105 of file file-io.cc.
References octave_stream_list::clear().
Referenced by do_octave_atexit().
|
static |
Definition at line 2160 of file file-io.cc.
References octave_value_list::length(), and print_usage().
Referenced by FSEEK_CUR(), FSEEK_END(), FSEEK_SET(), Fstderr(), Fstdin(), and Fstdout().
|
static |
Definition at line 2243 of file file-io.cc.
References octave_value_list::length(), and print_usage().
Definition at line 2084 of file file-io.cc.
References error().
Referenced by jit_function::call(), jit_function::do_return(), and Fumask().
|
static |
Definition at line 1347 of file file-io.cc.
References error(), error_state, octave_value::int_value(), octave_stream::read(), size(), oct_data_conv::string_to_data_type(), oct_mach_info::string_to_float_format(), octave_value::string_value(), and octave_value::vector_value().
Referenced by Ffread().
|
static |
Definition at line 1619 of file file-io.cc.
References error(), error_state, octave_value::int_value(), oct_data_conv::string_to_data_type(), oct_mach_info::string_to_float_format(), octave_value::string_value(), and octave_stream::write().
Referenced by Ffwrite().
|
static |
Definition at line 479 of file file-io.cc.
References octave_env::absolute_pathname(), octave_stdiostream::create(), octave_zstdiostream::create(), octave_stream::error(), error_state, base_file_stat::exists(), load_path::find_file(), fopen_mode_to_ios_mode(), base_file_stat::is_dir(), octave_env::make_absolute(), normalize_fopen_mode(), octave_env::rooted_relative_pathname(), oct_mach_info::string_to_float_format(), file_ops::tilde_expand(), and warning_with_id().
Referenced by do_stream_open(), and Ffopen().
|
static |
Definition at line 558 of file file-io.cc.
References do_stream_open(), error(), error_state, and octave_value::string_value().
OCTAVE_EXPORT octave_value_list Ffclear | ( | const octave_value_list & | args, |
int | |||
) |
Definition at line 266 of file file-io.cc.
References octave_stream::clearerr(), error_state, octave_stream_list::get_file_number(), octave_value::length(), octave_stream_list::lookup(), and print_usage().
OCTAVE_EXPORT octave_value_list Ffclose | ( | const octave_value_list & | args, |
int | |||
) |
Definition at line 247 of file file-io.cc.
References octave_value::length(), print_usage(), and octave_stream_list::remove().
OCTAVE_EXPORT octave_value_list Ffeof | ( | const octave_value_list & | args, |
int | |||
) |
Definition at line 1735 of file file-io.cc.
References octave_stream::eof(), error_state, octave_value::length(), octave_stream_list::lookup(), and print_usage().
Referenced by install_file_io_fcns().
OCTAVE_EXPORT octave_value_list Fferror | ( | const octave_value_list & | args, |
int | |||
) |
Definition at line 1766 of file file-io.cc.
References clear(), octave_stream::error(), error_state, octave_value_list::length(), octave_stream_list::lookup(), and print_usage().
Referenced by install_file_io_fcns().
OCTAVE_EXPORT octave_value_list Ffflush | ( | const octave_value_list & | args, |
int | |||
) |
Definition at line 298 of file file-io.cc.
References error_state, octave_stream::flush(), flush_octave_stdout(), octave_stream_list::get_file_number(), octave_value::length(), octave_stream_list::lookup(), and print_usage().
Referenced by gnuplot_graphics_toolkit::send_quit().
OCTAVE_EXPORT octave_value_list Ffgetl | ( | const octave_value_list & | args, |
int | |||
) |
Definition at line 345 of file file-io.cc.
References error_state, octave_stream::getl(), octave_value_list::length(), octave_stream_list::lookup(), octave_value(), and print_usage().
OCTAVE_EXPORT octave_value_list Ffgets | ( | const octave_value_list & | args, |
int | |||
) |
Definition at line 396 of file file-io.cc.
References error_state, octave_stream::gets(), octave_value_list::length(), octave_stream_list::lookup(), octave_value(), and print_usage().
OCTAVE_EXPORT octave_value_list Ffopen | ( | const octave_value_list & | args, |
int | nargout | ||
) |
Definition at line 680 of file file-io.cc.
References do_stream_open(), octave_stream::error(), error_state, octave_stream_list::get_info(), octave_stream_list::insert(), octave_value_list::length(), octave_value(), octave_stream_list::open_file_numbers(), and print_usage().
OCTAVE_EXPORT octave_value_list Ffprintf | ( | const octave_value_list & | args, |
int | nargout | ||
) |
Definition at line 883 of file file-io.cc.
References error(), error_state, octave_value::length(), octave_stream_list::lookup(), print_usage(), octave_stream::printf(), and octave_value_list::resize().
OCTAVE_EXPORT octave_value_list Ffputs | ( | const octave_value_list & | args, |
int | |||
) |
Definition at line 994 of file file-io.cc.
References error_state, octave_value::length(), octave_stream_list::lookup(), print_usage(), and octave_stream::puts().
Referenced by gnuplot_graphics_toolkit::send_quit().
OCTAVE_EXPORT octave_value_list Ffread | ( | const octave_value_list & | args, |
int | |||
) |
Definition at line 1565 of file file-io.cc.
References do_fread(), error_state, octave_value::is_string(), octave_value_list::length(), lo_ieee_inf_value(), octave_stream_list::lookup(), print_usage(), and size().
OCTAVE_EXPORT octave_value_list Ffreport | ( | const octave_value_list & | args, |
int | |||
) |
Definition at line 765 of file file-io.cc.
References octave_value_list::length(), octave_stream_list::list_open_files(), octave_stdout, and warning().
OCTAVE_EXPORT octave_value_list Ffrewind | ( | const octave_value_list & | args, |
int | nargout | ||
) |
Definition at line 786 of file file-io.cc.
References error_state, octave_value::length(), octave_stream_list::lookup(), print_usage(), and octave_stream::rewind().
OCTAVE_EXPORT octave_value_list Ffscanf | ( | const octave_value_list & | args, |
int | |||
) |
Definition at line 1145 of file file-io.cc.
References error(), octave_stream::error(), error_state, octave_value_list::length(), lo_ieee_inf_value(), octave_stream_list::lookup(), octave_stream::oscanf(), print_usage(), octave_stream::scanf(), and size().
Referenced by Fscanf().
OCTAVE_EXPORT octave_value_list Ffseek | ( | const octave_value_list & | args, |
int | |||
) |
Definition at line 827 of file file-io.cc.
References error_state, octave_value::length(), octave_stream_list::lookup(), octave_value(), print_usage(), and octave_stream::seek().
OCTAVE_EXPORT octave_value_list Ffskipl | ( | const octave_value_list & | args, |
int | |||
) |
Definition at line 447 of file file-io.cc.
References error_state, octave_value::length(), octave_stream_list::lookup(), octave_value(), print_usage(), and octave_stream::skipl().
OCTAVE_EXPORT octave_value_list Fftell | ( | const octave_value_list & | args, |
int | |||
) |
Definition at line 857 of file file-io.cc.
References error_state, octave_value::length(), octave_stream_list::lookup(), print_usage(), and octave_stream::tell().
OCTAVE_EXPORT octave_value_list Ffwrite | ( | const octave_value_list & | args, |
int | |||
) |
Definition at line 1682 of file file-io.cc.
References do_fwrite(), error_state, octave_value::is_string(), octave_value::length(), octave_stream_list::lookup(), and print_usage().
OCTAVE_EXPORT octave_value_list Fmkstemp | ( | const octave_value_list & | args, |
int | |||
) |
Definition at line 2016 of file file-io.cc.
References octave_stdiostream::create(), error(), error_state, fopen_mode_to_ios_mode(), octave_stream_list::insert(), is_true(), octave_value_list::length(), mark_for_deletion(), OCTAVE_LOCAL_BUFFER, and print_usage().
|
static |
Definition at line 200 of file file-io.cc.
References error(), and error_state.
Referenced by do_stream_open(), Fmkstemp(), and Ftmpfile().
OCTAVE_EXPORT octave_value_list FP_tmpdir | ( | const octave_value_list & | args, |
int | |||
) |
Definition at line 2179 of file file-io.cc.
References get_P_tmpdir(), octave_value::length(), and print_usage().
Referenced by install_file_io_fcns().
OCTAVE_EXPORT octave_value_list Fpclose | ( | const octave_value_list & | args, |
int | |||
) |
Definition at line 1884 of file file-io.cc.
References octave_value::length(), print_usage(), and octave_stream_list::remove().
Referenced by install_file_io_fcns(), and gnuplot_graphics_toolkit::send_quit().
OCTAVE_EXPORT octave_value_list Fpopen | ( | const octave_value_list & | args, |
int | |||
) |
Definition at line 1836 of file file-io.cc.
References octave_iprocstream::create(), octave_oprocstream::create(), error(), error_state, octave_stream_list::insert(), octave_value::length(), and print_usage().
OCTAVE_EXPORT octave_value_list Fprintf | ( | const octave_value_list & | args, |
int | nargout | ||
) |
Definition at line 949 of file file-io.cc.
References error(), octave_value::length(), print_usage(), octave_stream::printf(), and octave_value_list::resize().
OCTAVE_EXPORT octave_value_list Fputs | ( | const octave_value_list & | args, |
int | |||
) |
Definition at line 1022 of file file-io.cc.
References print_usage(), and octave_stream::puts().
OCTAVE_EXPORT octave_value_list Fscanf | ( | const octave_value_list & | args, |
int | nargout | ||
) |
Definition at line 1333 of file file-io.cc.
References Ffscanf().
OCTAVE_EXPORT octave_value_list FSEEK_CUR | ( | const octave_value_list & | args, |
int | |||
) |
Definition at line 2226 of file file-io.cc.
References const_value().
Referenced by install_file_io_fcns().
OCTAVE_EXPORT octave_value_list FSEEK_END | ( | const octave_value_list & | args, |
int | |||
) |
Definition at line 2237 of file file-io.cc.
References const_value().
Referenced by install_file_io_fcns().
OCTAVE_EXPORT octave_value_list FSEEK_SET | ( | const octave_value_list & | args, |
int | |||
) |
Definition at line 2215 of file file-io.cc.
References const_value().
Referenced by install_file_io_fcns().
OCTAVE_EXPORT octave_value_list Fsprintf | ( | const octave_value_list & | args, |
int | |||
) |
Definition at line 1045 of file file-io.cc.
References error(), octave_stream::error(), octave_value::is_sq_string(), octave_value::is_string(), octave_stream::is_valid(), octave_value_list::length(), octave_value(), print_usage(), octave_stream::printf(), octave_value_list::resize(), and octave_ostrstream::str().
Referenced by handle_message().
OCTAVE_EXPORT octave_value_list Fsscanf | ( | const octave_value_list & | args, |
int | |||
) |
Definition at line 1236 of file file-io.cc.
References octave_istrstream::create(), octave_stream::eof(), error(), octave_stream::error(), error_state, get_sscanf_data(), octave_stream::is_valid(), octave_value_list::length(), lo_ieee_inf_value(), octave_stream::oscanf(), print_usage(), octave_stream::scanf(), size(), and octave_stream::tell().
OCTAVE_EXPORT octave_value_list Fstderr | ( | const octave_value_list & | args, |
int | |||
) |
Definition at line 2288 of file file-io.cc.
References const_value().
Referenced by install_file_io_fcns().
OCTAVE_EXPORT octave_value_list Fstdin | ( | const octave_value_list & | args, |
int | |||
) |
Definition at line 2265 of file file-io.cc.
References const_value().
Referenced by install_file_io_fcns().
OCTAVE_EXPORT octave_value_list Fstdout | ( | const octave_value_list & | args, |
int | |||
) |
Definition at line 2276 of file file-io.cc.
References const_value().
Referenced by install_file_io_fcns().
OCTAVE_EXPORT octave_value_list Ftmpfile | ( | const octave_value_list & | args, |
int | |||
) |
Definition at line 1958 of file file-io.cc.
References octave_stdiostream::create(), error(), fopen_mode_to_ios_mode(), octave_stream_list::insert(), octave_value_list::length(), and print_usage().
OCTAVE_EXPORT octave_value_list Ftmpnam | ( | const octave_value_list & | args, |
int | |||
) |
Definition at line 1915 of file file-io.cc.
References error(), error_state, octave_value::length(), octave_tempnam(), and print_usage().
Referenced by install_file_io_fcns().
OCTAVE_EXPORT octave_value_list Fumask | ( | const octave_value_list & | args, |
int | |||
) |
Definition at line 2119 of file file-io.cc.
References convert(), error(), error_state, octave_umask(), and print_usage().
Referenced by install_file_io_fcns().
|
static |
Definition at line 1210 of file file-io.cc.
References error(), octave_value::is_string(), octave_value::numel(), octave_value::reshape(), and octave_value::string_value().
Referenced by Fsscanf().
Definition at line 88 of file file-io.cc.
References octave_istream::create(), octave_ostream::create(), octave_stream_list::insert(), and octave_stdout.
Referenced by octave_initialize_interpreter().
void mark_for_deletion | ( | const std::string & | file | ) |
Definition at line 117 of file file-io.cc.
Referenced by Fmkstemp().
Definition at line 134 of file file-io.cc.
References error(), error_state, and warning_with_id().
Referenced by do_stream_open().
|
static |
Definition at line 81 of file file-io.cc.
|
static |
Definition at line 85 of file file-io.cc.
|
static |
Definition at line 79 of file file-io.cc.
|
static |
Definition at line 83 of file file-io.cc.
|
static |
Definition at line 80 of file file-io.cc.
|
static |
Definition at line 84 of file file-io.cc.
std::stack<std::string> tmp_files |
Definition at line 114 of file file-io.cc.