aboutsummaryrefslogtreecommitdiff
path: root/teste.lua
diff options
context:
space:
mode:
authortomas <tomas>2004-07-27 14:15:24 +0000
committertomas <tomas>2004-07-27 14:15:24 +0000
commit8addf14a396466982f62503a6dfa5793a53b1b8e (patch)
tree74d9db96683d623e3e789e2e51c7434da7ef6be4 /teste.lua
downloadluafilesystem-8addf14a396466982f62503a6dfa5793a53b1b8e.tar.gz
luafilesystem-8addf14a396466982f62503a6dfa5793a53b1b8e.tar.bz2
luafilesystem-8addf14a396466982f62503a6dfa5793a53b1b8e.zip
Initial revision
Diffstat (limited to 'teste.lua')
-rw-r--r--teste.lua26
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
3require"luafilesystem"
4
5print(luafilesystem.version)
6
7function p ()
8 local fh = assert (io.open ("teste", 'r'))
9 assert (luafilesystem.lock (fh, 'r'))
10 print (fh:read"*a")
11 fh:close ()
12end
13
14function wr ()
15 fh = assert (io.open ("teste", 'w'))
16 assert (luafilesystem.lock (fh, 'w'))
17end
18
19function op ()
20 fh = assert (io.open ("teste", 'r'))
21 assert (luafilesystem.lock (fh, 'r'))
22end
23
24function fw (x)
25 assert (fh:write (x))
26end