diff options
Diffstat (limited to 'teste.lua')
-rw-r--r-- | teste.lua | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -1,24 +1,24 @@ | |||
1 | #!/usr/local/bin/lua -i | 1 | #!/usr/local/bin/lua -i |
2 | 2 | ||
3 | require"luafilesystem" | 3 | require"lfs" |
4 | 4 | ||
5 | print(luafilesystem.version) | 5 | print(lfs.version) |
6 | 6 | ||
7 | function p () | 7 | function p () |
8 | local fh = assert (io.open ("teste", 'r')) | 8 | local fh = assert (io.open ("teste", 'r')) |
9 | assert (luafilesystem.lock (fh, 'r')) | 9 | assert (lfs.lock (fh, 'r')) |
10 | print (fh:read"*a") | 10 | print (fh:read"*a") |
11 | fh:close () | 11 | fh:close () |
12 | end | 12 | end |
13 | 13 | ||
14 | function wr () | 14 | function wr () |
15 | fh = assert (io.open ("teste", 'w')) | 15 | fh = assert (io.open ("teste", 'w')) |
16 | assert (luafilesystem.lock (fh, 'w')) | 16 | assert (lfs.lock (fh, 'w')) |
17 | end | 17 | end |
18 | 18 | ||
19 | function op () | 19 | function op () |
20 | fh = assert (io.open ("teste", 'r')) | 20 | fh = assert (io.open ("teste", 'r')) |
21 | assert (luafilesystem.lock (fh, 'r')) | 21 | assert (lfs.lock (fh, 'r')) |
22 | end | 22 | end |
23 | 23 | ||
24 | function fw (x) | 24 | function fw (x) |