Mercurial > octave
comparison libinterp/corefcn/__ftp__.cc @ 32080:e9fdfebc6db0
Avoid using file_stat in libinterp/corefcn (bug #59711).
* dirfnc.cc (F__mkdir__), file-io.cc (do_stream_open), graphics.cc (Fdrawnow),
interpreter.cc (interpreter::execute_startup_files),
load-path.cc (load_path::find_file, load_path::find_dir,
load_path::find_matching_dirs, load_path::find_first_of,
load_path::find_all_first_of, load_path::execute_pkg_add_or_del,
load_path::add, load_path::find_private_file,
load_path::dir_info::get_file_list, load_path::dir_info::get_method_file_map,
genpath), load-save.cc (find_file_to_load),
ls-mat5.cc (read_mat5_binary_element), urlwrite (Furlwrite),
utils.cc (find_data_file_in_load_path, fcn_file_in_path),
__ftp__.cc (F__ftp_mput__), __magick_read__.cc (F__magick_write__): Use
functions "dir_exists" or "file_exists" instead of "file_stat".
author | Markus Mützel <markus.muetzel@gmx.de> |
---|---|
date | Sat, 06 May 2023 13:08:38 +0200 |
parents | 597f3ee61a48 |
children | 2e484f9f1f18 |
comparison
equal
deleted
inserted
replaced
32079:b0785d76430a | 32080:e9fdfebc6db0 |
---|---|
365 | 365 |
366 for (octave_idx_type i = 0; i < files.numel (); i++) | 366 for (octave_idx_type i = 0; i < files.numel (); i++) |
367 { | 367 { |
368 std::string file = files(i); | 368 std::string file = files(i); |
369 | 369 |
370 sys::file_stat fs (file); | 370 if (! sys::file_exists (file)) |
371 | |
372 if (! fs.exists ()) | |
373 error ("__ftp__mput: file does not exist"); | 371 error ("__ftp__mput: file does not exist"); |
374 | 372 |
375 if (fs.is_dir ()) | 373 if (sys::dir_exists (file)) |
376 { | 374 { |
377 file_list.append (url_xfer.mput_directory ("", file)); | 375 file_list.append (url_xfer.mput_directory ("", file)); |
378 | 376 |
379 if (! url_xfer.good ()) | 377 if (! url_xfer.good ()) |
380 error ("__ftp_mput__: %s", url_xfer.lasterror ().c_str ()); | 378 error ("__ftp_mput__: %s", url_xfer.lasterror ().c_str ()); |