Lines Matching defs:ec
87 static path __do_absolute(const path& p, path* cwd, error_code* ec) {
88 if (ec)
89 ec->clear();
92 *cwd = __current_path(ec);
93 if (ec && *ec)
98 path __absolute(const path& p, error_code* ec) {
100 return __do_absolute(p, &cwd, ec);
103 path __canonical(path const& orig_p, error_code* ec) {
105 ErrorHandler<path> err("canonical", ec, &orig_p, &cwd);
107 path p = __do_absolute(orig_p, &cwd, ec);
126 void __copy(const path& from, const path& to, copy_options options, error_code* ec) {
127 ErrorHandler<void> err("copy", ec, &from, &to);
155 __copy_symlink(from, to, ec);
164 __create_symlink(from, to, ec);
166 __create_hard_link(from, to, ec);
168 __copy_file(from, to / from.filename(), options, ec);
170 __copy_file(from, to, options, ec);
178 __create_directory(to, from, ec);
179 if (ec && *ec) {
183 directory_iterator it = ec ? directory_iterator(from, *ec) : directory_iterator(from);
184 if (ec && *ec) {
189 __copy(it->path(), to / it->path().filename(), options | copy_options::__in_recursive_copy, ec);
190 if (ec && *ec) {
204 bool copy_file_impl_fstream(FileDescriptor& read_fd, FileDescriptor& write_fd, error_code& ec) {
209 ec = capture_errno();
216 ec = capture_errno();
230 ec = make_error_code(errc::io_error);
234 ec.clear();
240 bool copy_file_impl_copy_file_range(FileDescriptor& read_fd, FileDescriptor& write_fd, error_code& ec) {
245 ec = {EINVAL, generic_category()};
261 ec = capture_errno();
267 ec.clear();
274 bool copy_file_impl_sendfile(FileDescriptor& read_fd, FileDescriptor& write_fd, error_code& ec) {
282 ec = {EINVAL, generic_category()};
289 ec = capture_errno();
295 ec.clear();
304 bool copy_file_impl(FileDescriptor& read_fd, FileDescriptor& write_fd, error_code& ec) {
306 if (copy_file_impl_copy_file_range(read_fd, write_fd, ec)) {
321 if (ec.value() != EINVAL && ec.value() != ENOTSUP && ec.value() != EOPNOTSUPP && ec.value() != ETXTBSY &&
322 ec.value() != EXDEV && ec.value() != ENOENT && ec.value() != ENOSYS) {
325 ec.clear();
329 if (copy_file_impl_sendfile(read_fd, write_fd, ec)) {
333 if (ec.value() != EINVAL) {
336 ec.clear();
340 return copy_file_impl_fstream(read_fd, write_fd, ec);
343 ec.assign(EINVAL, std::system_category());
348 bool copy_file_impl(FileDescriptor& read_fd, FileDescriptor& write_fd, error_code& ec) {
361 ec = capture_errno();
365 ec.clear();
369 bool copy_file_impl(FileDescriptor& read_fd, FileDescriptor& write_fd, error_code& ec) {
370 return copy_file_impl_fstream(read_fd, write_fd, ec);
379 bool __copy_file(const path& from, const path& to, copy_options options, error_code* ec) {
381 ErrorHandler<bool> err("copy_file", ec, &to, &from);
463 void __copy_symlink(const path& existing_symlink, const path& new_symlink, error_code* ec) {
464 const path real_path(__read_symlink(existing_symlink, ec));
465 if (ec && *ec) {
471 __create_directory_symlink(real_path, new_symlink, ec);
474 __create_symlink(real_path, new_symlink, ec);
477 bool __create_directories(const path& p, error_code* ec) {
478 ErrorHandler<bool> err("create_directories", ec, &p);
497 __create_directories(parent, ec);
498 if (ec && *ec) {
510 bool __create_directory(const path& p, error_code* ec) {
511 ErrorHandler<bool> err("create_directory", ec, &p);
526 bool __create_directory(path const& p, path const& attributes, error_code* ec) {
527 ErrorHandler<bool> err("create_directory", ec, &p, &attributes);
551 void __create_directory_symlink(path const& from, path const& to, error_code* ec) {
552 ErrorHandler<void> err("create_directory_symlink", ec, &from, &to);
557 void __create_hard_link(const path& from, const path& to, error_code* ec) {
558 ErrorHandler<void> err("create_hard_link", ec, &from, &to);
563 void __create_symlink(path const& from, path const& to, error_code* ec) {
564 ErrorHandler<void> err("create_symlink", ec, &from, &to);
569 path __current_path(error_code* ec) {
570 ErrorHandler<path> err("current_path", ec);
614 void __current_path(const path& p, error_code* ec) {
615 ErrorHandler<void> err("current_path", ec, &p);
620 bool __equivalent(const path& p1, const path& p2, error_code* ec) {
621 ErrorHandler<bool> err("equivalent", ec, &p1, &p2);
635 uintmax_t __file_size(const path& p, error_code* ec) {
636 ErrorHandler<uintmax_t> err("file_size", ec, &p);
651 uintmax_t __hard_link_count(const path& p, error_code* ec) {
652 ErrorHandler<uintmax_t> err("hard_link_count", ec, &p);
662 bool __fs_is_empty(const path& p, error_code* ec) {
663 ErrorHandler<bool> err("is_empty", ec, &p);
673 auto it = ec ? directory_iterator(p, *ec) : directory_iterator(p);
674 if (ec && *ec)
683 file_time_type __last_write_time(const path& p, error_code* ec) {
685 ErrorHandler<file_time_type> err("last_write_time", ec, &p);
692 return detail::__extract_last_write_time(p, st, ec);
695 void __last_write_time(const path& p, file_time_type new_time, error_code* ec) {
697 ErrorHandler<void> err("last_write_time", ec, &p);
734 void __permissions(const path& p, perms prms, perm_options opts, error_code* ec) {
735 ErrorHandler<void> err("permissions", ec, &p);
777 path __read_symlink(const path& p, error_code* ec) {
778 ErrorHandler<path> err("read_symlink", ec, &p);
809 bool __remove(const path& p, error_code* ec) {
810 ErrorHandler<bool> err("remove", ec, &p);
835 uintmax_t remove_all_impl(path const& p, error_code& ec) {
837 const file_status st = __symlink_status(p, &ec);
838 if (ec)
842 for (directory_iterator it(p, ec); !ec && it != directory_iterator(); it.increment(ec)) {
843 auto other_count = remove_all_impl(it->path(), ec);
844 if (ec)
848 if (ec)
851 if (!__remove(p, &ec))
858 uintmax_t __remove_all(const path& p, error_code* ec) {
859 ErrorHandler<uintmax_t> err("remove_all", ec, &p);
886 uintmax_t remove_all_impl(int parent_directory, const path& p, error_code& ec) {
896 ec = detail::capture_errno();
905 auto [str, type] = detail::posix_readdir(stream, ec);
909 } else if (ec || str.empty()) {
912 count += remove_all_impl(fd, str, ec);
918 ec = detail::capture_errno();
925 ec = detail::capture_errno();
929 if (ec == errc::no_such_file_or_directory) {
930 ec.clear();
938 if (ec == errc::not_a_directory || ec == errc::too_many_symbolic_link_levels || ec == errc::too_many_links) {
939 ec.clear();
941 ec = detail::capture_errno();
953 uintmax_t __remove_all(const path& p, error_code* ec) {
954 ErrorHandler<uintmax_t> err("remove_all", ec, &p);
964 void __rename(const path& from, const path& to, error_code* ec) {
965 ErrorHandler<void> err("rename", ec, &from, &to);
970 void __resize_file(const path& p, uintmax_t size, error_code* ec) {
971 ErrorHandler<void> err("resize_file", ec, &p);
976 space_info __space(const path& p, error_code* ec) {
977 ErrorHandler<void> err("space", ec, &p);
997 file_status __status(const path& p, error_code* ec) { return detail::posix_stat(p, ec); }
999 file_status __symlink_status(const path& p, error_code* ec) { return detail::posix_lstat(p, ec); }
1001 path __temp_directory_path(error_code* ec) {
1002 ErrorHandler<path> err("temp_directory_path", ec);
1044 path __weakly_canonical(const path& p, error_code* ec) {
1045 ErrorHandler<path> err("weakly_canonical", ec, &p);
1048 return __canonical("", ec);