diff options
author | 2016-03-12 12:31:13 +0100 | |
---|---|---|
committer | 2016-03-12 12:31:13 +0100 | |
commit | a026a582f1a0ea8c1ede3acaddacef506ef3f3b0 (patch) | |
tree | e31573822f2359677de519f9f3b600d98e8764cd /3rdparty/luv/examples/uvbook/uvcat.lua | |
parent | 477d2abd43984f076b7e45f5527591fa8fd0d241 (diff) | |
parent | dcab55bf53b94713a6f72e9633f5101c8dd6c08c (diff) |
Merge pull request #15 from mamedev/master
Sync to base master
Diffstat (limited to '3rdparty/luv/examples/uvbook/uvcat.lua')
-rw-r--r-- | 3rdparty/luv/examples/uvbook/uvcat.lua | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/3rdparty/luv/examples/uvbook/uvcat.lua b/3rdparty/luv/examples/uvbook/uvcat.lua deleted file mode 100644 index 99fdd68000b..00000000000 --- a/3rdparty/luv/examples/uvbook/uvcat.lua +++ /dev/null @@ -1,37 +0,0 @@ -local uv = require('luv') - - -local fname = arg[1] and arg[1] or arg[0] - -uv.fs_open(fname, 'r', tonumber('644', 8), function(err,fd) - if err then - print("error opening file:"..err) - else - local stat = uv.fs_fstat(fd) - local off = 0 - local block = 10 - - local function on_read(err,chunk) - if(err) then - print("Read error: "..err); - elseif #chunk==0 then - uv.fs_close(fd) - else - off = block + off - uv.fs_write(1,chunk,-1,function(err,chunk) - if err then - print("Write error: "..err) - else - uv.fs_read(fd, block, off, on_read) - end - end) - end - end - uv.fs_read(fd, block, off, on_read) - end -end) - - - -uv.run('default') -uv.loop_close() |