diff options
author | tomas <tomas> | 2004-07-27 14:15:24 +0000 |
---|---|---|
committer | tomas <tomas> | 2004-07-27 14:15:24 +0000 |
commit | 8addf14a396466982f62503a6dfa5793a53b1b8e (patch) | |
tree | 74d9db96683d623e3e789e2e51c7434da7ef6be4 /teste.lua | |
download | luafilesystem-8addf14a396466982f62503a6dfa5793a53b1b8e.tar.gz luafilesystem-8addf14a396466982f62503a6dfa5793a53b1b8e.tar.bz2 luafilesystem-8addf14a396466982f62503a6dfa5793a53b1b8e.zip |
Initial revision
Diffstat (limited to 'teste.lua')
-rw-r--r-- | teste.lua | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/teste.lua b/teste.lua new file mode 100644 index 0000000..ec6da44 --- /dev/null +++ b/teste.lua | |||
@@ -0,0 +1,26 @@ | |||
1 | #!/usr/local/bin/lua -i | ||
2 | |||
3 | require"luafilesystem" | ||
4 | |||
5 | print(luafilesystem.version) | ||
6 | |||
7 | function p () | ||
8 | local fh = assert (io.open ("teste", 'r')) | ||
9 | assert (luafilesystem.lock (fh, 'r')) | ||
10 | print (fh:read"*a") | ||
11 | fh:close () | ||
12 | end | ||
13 | |||
14 | function wr () | ||
15 | fh = assert (io.open ("teste", 'w')) | ||
16 | assert (luafilesystem.lock (fh, 'w')) | ||
17 | end | ||
18 | |||
19 | function op () | ||
20 | fh = assert (io.open ("teste", 'r')) | ||
21 | assert (luafilesystem.lock (fh, 'r')) | ||
22 | end | ||
23 | |||
24 | function fw (x) | ||
25 | assert (fh:write (x)) | ||
26 | end | ||