aboutsummaryrefslogtreecommitdiff
path: root/doc/us/examples.html
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2022-06-24 12:12:13 -0300
committerHisham Muhammad <hisham@gobolinux.org>2022-06-24 12:27:22 -0300
commit9cbe5cba9047b449308e1365690b0a5acfdef181 (patch)
treea0d41adda3403b587fd195ffe1187016c7b41629 /doc/us/examples.html
parent772fe81c6723c96be0c784c2ad6220ef5018a84a (diff)
downloadluafilesystem-9cbe5cba9047b449308e1365690b0a5acfdef181.tar.gz
luafilesystem-9cbe5cba9047b449308e1365690b0a5acfdef181.tar.bz2
luafilesystem-9cbe5cba9047b449308e1365690b0a5acfdef181.zip
Move doc/us/ to docs/, replacing the gh-pages branch.
Diffstat (limited to 'doc/us/examples.html')
-rw-r--r--doc/us/examples.html101
1 files changed, 0 insertions, 101 deletions
diff --git a/doc/us/examples.html b/doc/us/examples.html
deleted file mode 100644
index 68756c8..0000000
--- a/doc/us/examples.html
+++ /dev/null
@@ -1,101 +0,0 @@
1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4<head>
5 <title>LuaFileSystem</title>
6 <link rel="stylesheet" href="doc.css" type="text/css"/>
7 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
8</head>
9
10<body>
11
12<div id="container">
13
14<div id="product">
15 <div id="product_logo">
16 <a href="http://keplerproject.github.io/luafilesystem">
17 <img alt="LuaFileSystem" src="luafilesystem.png"/>
18 </a>
19 </div>
20 <div id="product_name"><big><strong>LuaFileSystem</strong></big></div>
21 <div id="product_description">File System Library for the Lua Programming Language</div>
22</div> <!-- id="product" -->
23
24<div id="main">
25
26<div id="navigation">
27<h1>LuaFileSystem</h1>
28 <ul>
29 <li><a href="index.html">Home</a>
30 <ul>
31 <li><a href="index.html#overview">Overview</a></li>
32 <li><a href="index.html#status">Status</a></li>
33 <li><a href="index.html#download">Download</a></li>
34 <li><a href="index.html#history">History</a></li>
35 <li><a href="index.html#credits">Credits</a></li>
36 </ul>
37 </li>
38 <li><a href="manual.html">Manual</a>
39 <ul>
40 <li><a href="manual.html#introduction">Introduction</a></li>
41 <li><a href="manual.html#building">Building</a></li>
42 <li><a href="manual.html#installation">Installation</a></li>
43 <li><a href="manual.html#reference">Reference</a></li>
44 </ul>
45 </li>
46 <li><strong>Examples</strong></li>
47 <li><a href="https://github.com/keplerproject/luafilesystem">Project</a>
48 <ul>
49 <li><a href="https://github.com/keplerproject/luafilesystem/issues">Bug Tracker</a></li>
50 <li><a href="https://github.com/keplerproject/luafilesystem">Git</a></li>
51 </ul>
52 </li>
53 <li><a href="license.html">License</a></li>
54 </ul>
55</div> <!-- id="navigation" -->
56
57<div id="content">
58
59<h2><a name="example"></a>Examples</h2>
60
61<h3>Directory iterator</h3>
62
63<p>The following example iterates over a directory and recursively lists the
64attributes for each file inside it.</p>
65
66<pre class="example">
67local lfs = require"lfs"
68
69function attrdir (path)
70 for file in lfs.dir(path) do
71 if file ~= "." and file ~= ".." then
72 local f = path..'/'..file
73 print ("\t "..f)
74 local attr = lfs.attributes (f)
75 assert (type(attr) == "table")
76 if attr.mode == "directory" then
77 attrdir (f)
78 else
79 for name, value in pairs(attr) do
80 print (name, value)
81 end
82 end
83 end
84 end
85end
86
87attrdir (".")
88</pre>
89
90</div> <!-- id="content" -->
91
92</div> <!-- id="main" -->
93
94<div id="about">
95 <p><a href="http://validator.w3.org/check?uri=referer">Valid XHTML 1.0!</a></p>
96</div> <!-- id="about" -->
97
98</div> <!-- id="container" -->
99
100</body>
101</html>