GNU Octave
4.0.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 |
void cleanup_tmp_files | ( | void | ) |
Definition at line 123 of file file-io.cc.
Referenced by do_octave_atexit().
void close_files | ( | void | ) |
Definition at line 105 of file file-io.cc.
References octave_stream_list::clear().
Referenced by do_octave_atexit().
|
static |
Definition at line 2293 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 2382 of file file-io.cc.
References octave_value_list::length(), and print_usage().
Definition at line 2208 of file file-io.cc.
References error().
Referenced by jit_function::call(), jit_function::do_return(), and Fumask().
|
static |
Definition at line 1393 of file file-io.cc.
References error(), error_state, octave_value::int_value(), octave_value::is_string(), 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 1669 of file file-io.cc.
References error(), error_state, octave_value::int_value(), octave_value::is_string(), 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 493 of file file-io.cc.
References octave_stdiostream::create(), octave_zstdiostream::create(), octave_stream::error(), error_state, find_data_file_in_load_path(), fopen_mode_to_ios_mode(), base_file_stat::is_dir(), normalize_fopen_mode(), oct_mach_info::string_to_float_format(), and file_ops::tilde_expand().
Referenced by do_stream_open(), and Ffopen().
|
static |
Definition at line 557 of file file-io.cc.
References do_stream_open(), error(), octave_value::is_string(), and octave_value::string_value().
OCTAVE_EXPORT octave_value_list Ffclear | ( | const octave_value_list & | args, |
int | |||
) |
Definition at line 274 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 Ffeof | ( | const octave_value_list & | args, |
int | |||
) |
Definition at line 1791 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 1829 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 Ffgetl | ( | const octave_value_list & | args, |
int | |||
) |
Definition at line 356 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 408 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 689 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 907 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 1027 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 1615 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 776 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 800 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 1191 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 Ffskipl | ( | const octave_value_list & | args, |
int | |||
) |
Definition at line 461 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 871 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 1736 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 2140 of file file-io.cc.
References octave_stdiostream::create(), error(), 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 2318 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 1953 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 1903 of file file-io.cc.
References octave_iprocstream::create(), octave_oprocstream::create(), error(), octave_stream_list::insert(), octave_value::length(), and print_usage().
Referenced by install_file_io_fcns().
OCTAVE_EXPORT octave_value_list Fprintf | ( | const octave_value_list & | args, |
int | nargout | ||
) |
Definition at line 977 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 1059 of file file-io.cc.
References print_usage(), and octave_stream::puts().
OCTAVE_EXPORT octave_value_list Frpl_fclose | ( | const octave_value_list & | args, |
int | |||
) |
Definition at line 254 of file file-io.cc.
References octave_value::length(), print_usage(), and octave_stream_list::remove().
OCTAVE_EXPORT octave_value_list Frpl_fflush | ( | const octave_value_list & | args, |
int | |||
) |
Definition at line 308 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().
OCTAVE_EXPORT octave_value_list Frpl_fseek | ( | const octave_value_list & | args, |
int | |||
) |
Definition at line 841 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 Fscanf | ( | const octave_value_list & | args, |
int | nargout | ||
) |
Definition at line 1379 of file file-io.cc.
References Ffscanf().
OCTAVE_EXPORT octave_value_list FSEEK_CUR | ( | const octave_value_list & | args, |
int | |||
) |
Definition at line 2365 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 2376 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 2354 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 1087 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 1283 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 2430 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 2405 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 2417 of file file-io.cc.
References const_value().
Referenced by install_file_io_fcns().
OCTAVE_EXPORT octave_value_list Ftempname | ( | const octave_value_list & | args, |
int | |||
) |
Definition at line 1985 of file file-io.cc.
References error(), octave_value::length(), octave_tempnam(), and print_usage().
OCTAVE_EXPORT octave_value_list Ftmpfile | ( | const octave_value_list & | args, |
int | |||
) |
Definition at line 2080 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 Fumask | ( | const octave_value_list & | args, |
int | |||
) |
Definition at line 2252 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 1256 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().
void initialize_file_io | ( | void | ) |
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().
|
static |
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.