summaryrefslogtreecommitdiff
path: root/tests/modules/pipe/pipe_pair.lua
blob: da38f81ff3145cc104e52fe11d16e7ebed8b01c5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import("core.base.pipe")
import("core.base.bytes")

function main()
    local buff = bytes(8192)
    local rpipe, wpipe = pipe.openpair()
    wpipe:write("hello xmake!", {block = true})
    local read, data = rpipe:read(buff, 13)
    if read > 0 and data then
        data:dump()
    end
    rpipe:close()
    wpipe:close()
end