blob: 4061b08b6fcfd40bddac2a00610dfc48fe2431fc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
import("core.base.pipe")
function main(name)
local pipefile = pipe.open(name or "test", 'w')
local count = 0
while count < 10000 do
local write = pipefile:write("hello world..", {block = true})
if write <= 0 then
break
end
count = count + 1
end
print("%s: write ok, count: %d!", pipefile, count)
pipefile:close()
end
|