Skip to content

Instantly share code, notes, and snippets.

@vinipsmaker
Last active August 29, 2015 14:16
Show Gist options
  • Save vinipsmaker/467db84a09c49c410f30 to your computer and use it in GitHub Desktop.
Save vinipsmaker/467db84a09c49c410f30 to your computer and use it in GitHub Desktop.
string // task<string>
read(string file, string suffix, // read(string file, string suffix)
yield_context yield) { // __async {
istream fi = open(file, yield); // istream fi = __await open(file);
string ret, chunk;
while((chunk = fi.read(yield)).size()) // while((chunk = __await fi.read()).size())
ret += chunk + suffix;
return ret;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment