-
-
Save creationix/4af628ad6a8d02ad0f65 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
newFiber(function (wait, await) | |
local input = __filename | |
local output = __filename .. ".out2" | |
local readable = fs.ReadStream:new(await(fs.open(input, "r"))) | |
local writable = fs.WriteStream:new(await(fs.open(output, "w"))) | |
repeat | |
local chunk = await(readable:read()) | |
p{"chunk", chunk} | |
await(writable:write(chunk)) | |
until not chunk | |
p("done2") | |
end) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment