diff options
Diffstat (limited to '')
-rw-r--r-- | gem/ex5.lua | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/gem/ex5.lua b/gem/ex5.lua deleted file mode 100644 index 196b30a..0000000 --- a/gem/ex5.lua +++ /dev/null | |||
@@ -1,15 +0,0 @@ | |||
1 | function source.empty(err) | ||
2 | return function() | ||
3 | return nil, err | ||
4 | end | ||
5 | end | ||
6 | |||
7 | function source.file(handle, io_err) | ||
8 | if handle then | ||
9 | return function() | ||
10 | local chunk = handle:read(20) | ||
11 | if not chunk then handle:close() end | ||
12 | return chunk | ||
13 | end | ||
14 | else return source.empty(io_err or "unable to open file") end | ||
15 | end | ||