comparison liboctave/util/url-transfer.cc @ 28467:159b6a1eb408

Use wide character overload to open file streams on Windows. * liboctave/system/lo-sysdep.cc, liboctave/system/lo-sysdep.h (fstream, ifstream, ofstream): Add "wrapper" functions to open file streams. * libinterp/corefcn/__fcn__.cc (F__ftp_mput__, F__ftp_mget__), libinterp/corefcn/debug.cc (do_dbtype), libinterp/corefcn/help.cc (help_system::raw_help_from_docstrings_file), libinterp/corefcn/load-save.cc (check_gzip_magic, load_save_system::get_file_format, load_save_system::dump_octave_core, load_save_system::load, load_save_system::save), libinterp/corefcn/oct-hist.cc (mk_tmp_hist_file, history_system::do_edit_history), libinterp/corefcn/urlwrite.cc (Furlwrite), libinterp/octave-value/ov-java.cc (read_java_opts, read_classpath_txt), libinterp/parse-tree/oct-parse.yy (get_file_line), liboctave/util/cmd-hist.cc (gnu_history::do_append), liboctave/util/file-info.cc (file_info::snarf_file), liboctave/util/url-transfer.cc (base_url_transfer::mget_directory, base_url_transfer::mput_directory): Use new functions. * libinterp/corefcn/dlmread.cc (dlmread): Use wide character overload for std::ifstream::open on Windows. * src/mkoctfile.in.cc (octave_u8_conv_to_encoding): Dummy function for cross-compiler. (main): Use wide character overload of std::ofstream::open on Windows.
author Markus Mützel <markus.muetzel@gmx.de>
date Fri, 12 Jun 2020 22:13:04 +0200
parents 45763d59cb4f
children a98fd0657e35 0a5b15007766
comparison
equal deleted inserted replaced
28466:597e7cf93cac 28467:159b6a1eb408
119 mget_directory (sv(i), target + directory + sep); 119 mget_directory (sv(i), target + directory + sep);
120 else 120 else
121 { 121 {
122 std::string realfile = target + directory + sep + sv(i); 122 std::string realfile = target + directory + sep + sv(i);
123 123
124 std::ofstream ofile (realfile.c_str (), 124 std::ofstream ofile =
125 std::ios::out | std::ios::binary); 125 sys::ofstream (realfile.c_str (),
126 std::ios::out | std::ios::binary);
126 127
127 if (! ofile.is_open ()) 128 if (! ofile.is_open ())
128 { 129 {
129 m_ok = false; 130 m_ok = false;
130 m_errmsg = "__ftp_mget__: unable to open file"; 131 m_errmsg = "__ftp_mget__: unable to open file";
204 break; 205 break;
205 } 206 }
206 else 207 else
207 { 208 {
208 // FIXME: Does ascii mode need to be flagged here? 209 // FIXME: Does ascii mode need to be flagged here?
209 std::string ascii_fname = sys::get_ASCII_filename (realfile); 210 std::ifstream ifile =
210 211 sys::ifstream (realfile.c_str (),
211 std::ifstream ifile (ascii_fname.c_str (), 212 std::ios::in | std::ios::binary);
212 std::ios::in | std::ios::binary);
213 213
214 if (! ifile.is_open ()) 214 if (! ifile.is_open ())
215 { 215 {
216 m_ok = false; 216 m_ok = false;
217 m_errmsg = "__ftp_mput__: unable to open file '" 217 m_errmsg = "__ftp_mput__: unable to open file '"