aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortomas <tomas>2004-10-29 16:15:59 +0000
committertomas <tomas>2004-10-29 16:15:59 +0000
commitf66af01eece2627f8dbeb37426f4040107ca073a (patch)
treeb069287231bf3e116ff05315378266d8266499f1
parent40db9dba61acbbdf8474c900c522fa6d0b556763 (diff)
downloadluafilesystem-f66af01eece2627f8dbeb37426f4040107ca073a.tar.gz
luafilesystem-f66af01eece2627f8dbeb37426f4040107ca073a.tar.bz2
luafilesystem-f66af01eece2627f8dbeb37426f4040107ca073a.zip
Acrescimo de exemplo.
Acrescimo do logo.
-rw-r--r--doc/us/luafilesystem.pngbin0 -> 8535 bytes
-rw-r--r--doc/us/manual.html26
-rw-r--r--teste.lua10
3 files changed, 30 insertions, 6 deletions
diff --git a/doc/us/luafilesystem.png b/doc/us/luafilesystem.png
new file mode 100644
index 0000000..e1dd8c6
--- /dev/null
+++ b/doc/us/luafilesystem.png
Binary files differ
diff --git a/doc/us/manual.html b/doc/us/manual.html
index 733bd8a..ae20fcc 100644
--- a/doc/us/manual.html
+++ b/doc/us/manual.html
@@ -110,6 +110,30 @@ LuaFileSystem offers the following functions:
110<a name="example"></a> 110<a name="example"></a>
111<h2>Example</h2> 111<h2>Example</h2>
112 112
113<pre>
114require"lfs"
115
116function attrdir (path)
117 for file in lfs.dir(path) do
118 if file ~= "." and file ~= ".." then
119 local f = path..'/'..file
120 print ("\t "..f)
121 local attr = lfs.attributes (f)
122 assert (type(attr) == "table")
123 if attr.mode == "directory" then
124 attrdir (f)
125 else
126 for name, value in pairs(attr) do
127 print (name, value)
128 end
129 end
130 end
131 end
132end
133
134attrdir (".")
135</pre>
136
113 137
114<a name="contents"></a> 138<a name="contents"></a>
115<h2>Contents</h2> 139<h2>Contents</h2>
@@ -141,7 +165,7 @@ LuaFileSystem offers the following functions:
141 165
142<hr> 166<hr>
143<small> 167<small>
144$Id: manual.html,v 1.3 2004/10/27 18:01:42 tomas Exp $ 168$Id: manual.html,v 1.4 2004/10/29 16:15:59 tomas Exp $
145</small> 169</small>
146 170
147</body> 171</body>
diff --git a/teste.lua b/teste.lua
index ec6da44..556cab0 100644
--- a/teste.lua
+++ b/teste.lua
@@ -1,24 +1,24 @@
1#!/usr/local/bin/lua -i 1#!/usr/local/bin/lua -i
2 2
3require"luafilesystem" 3require"lfs"
4 4
5print(luafilesystem.version) 5print(lfs.version)
6 6
7function p () 7function 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 ()
12end 12end
13 13
14function wr () 14function 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'))
17end 17end
18 18
19function op () 19function 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'))
22end 22end
23 23
24function fw (x) 24function fw (x)