We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bool client::mkdir(const string& directory_name) { try { if (!is_open()) { throw ftp_exception("Connection is not open."); }
std::filesystem::path path(directory_name); auto ss = path.string(); if (ss == "")return false; try { if (ls(ss)) return true; } catch (...) { } std::vector<string> sub_dirs; for (auto& sub : path) { sub_dirs.push_back(sub.string()); } string to_dir; if (sub_dirs.empty()) { throw ftp_exception("MKD empty sub_dirs."); } reply_t reply; for (auto i = 0; i < sub_dirs.size(); i++) { auto s = sub_dirs[i]; if (s == "") break; to_dir += s; to_dir += "/"; reply = send_command("MKD " + to_dir); } if (reply.status_code == 550) return true; return reply.is_positive();
} catch (const connection_exception& ex) { reset_connection(); throw ftp_exception(ex); } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
bool client::mkdir(const string& directory_name) {
try {
if (!is_open()) {
throw ftp_exception("Connection is not open.");
}
} catch (const connection_exception& ex) {
reset_connection();
throw ftp_exception(ex);
}
}
The text was updated successfully, but these errors were encountered: