You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
std::string filename = "app_file.txt";
coro_io::coro_file file{};
file.open(filename, std::ios::out);
CHECK(file.is_open());
async_simple::coro::syncAwait(file.async_write("it is a test"));
file.close();
append file
std::string filename = "app_file.txt";
coro_io::coro_file file{};
file.open(filename, std::ios::app);
CHECK(file.is_open());
async_simple::coro::syncAwait(file.async_write("it is a test"));
file.close();
read file
std::string filename = "app_file";
coro_io::coro_file file{};
file.open(filename, std::ios::in);
CHECK(file.is_open());
std::string buf;
buf.resize(40);
auto [ec, sz] = async_simple::coro::syncAwait(file.async_read(buf.data(), buf.size()));
std::cout << std::string_view(buf.data(), sz) << "\n"; //output: it is a testit is a test
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
sequence read and write file.
create and write file
append file
read file
http server
Beta Was this translation helpful? Give feedback.
All reactions