aboutsummaryrefslogtreecommitdiff
path: root/doc/us/manual.html
diff options
context:
space:
mode:
Diffstat (limited to 'doc/us/manual.html')
-rw-r--r--doc/us/manual.html267
1 files changed, 136 insertions, 131 deletions
diff --git a/doc/us/manual.html b/doc/us/manual.html
index ec92531..0d9ab61 100644
--- a/doc/us/manual.html
+++ b/doc/us/manual.html
@@ -1,133 +1,132 @@
1<! See Copyright Notice in license.html> 1<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<html> 2<html>
3
4<head> 3<head>
4<meta name="generator" content="HTML Tidy, see www.w3.org">
5<title>LuaFileSystem</title> 5<title>LuaFileSystem</title>
6<style type="text/css"> 6<style type="text/css">
7ul { list-style-type: disc }; 7ul { list-style-type: disc };
8</style> 8</style>
9</head> 9</head>
10
11<body bgcolor="#FFFFFF"> 10<body bgcolor="#FFFFFF">
12
13<hr> 11<hr>
14
15<center> 12<center>
16<table border=0 cellspacing=2 cellpadding=2> 13<table border="0" cellspacing="2" cellpadding="2">
17<tr><td align=center><a href="http://www.keplerproject.org/luafilesystem"> 14<tr>
18<img border=0 alt="LuaFileSystem logo" src="luafilesystem.png"></a> 15<td align="center"><a href=
19<tr><td align=center><big><b>LuaFileSystem Reference Manual</b></big> 16"http://www.keplerproject.org/luafilesystem"><img border="0" alt=
20<tr><td align=center valign=top>File system library for the 17"LuaFileSystem logo" src="luafilesystem.png"></a> </td>
21<a href="http://www.lua.org">Lua</a> 18</tr>
22programming language 19
20<tr>
21<td align="center"><big><b>LuaFileSystem Reference Manual</b></big>
22</td>
23</tr>
24
25<tr>
26<td align="center" valign="top">File system library for the <a
27href="http://www.lua.org">Lua</a> programming language</td>
28</tr>
23</table> 29</table>
24</center> 30</center>
25<p>
26 31
27<center><small> 32<center><small><a href="index.html">home</a> &middot; <a href=
28<a href="index.html">home</a> &middot; 33"#introduction">introduction</a> &middot; <a href=
29<a href="#introduction">introduction</a> &middot; 34"#reference">reference</a> &middot; <a href=
30<a href="#reference">reference</a> &middot; 35"#example">example</a></small></center>
31<a href="#example">example</a>
32</small></center>
33<p>
34 36
35<hr> 37<hr>
38<a name="introduction"></a>
36 39
37<a name="introduction"></a>
38<h2>Introduction</h2> 40<h2>Introduction</h2>
39 41
40<p> 42<p>LuaFileSystem is a <a href="http://www.lua.org">Lua</a> library
41LuaFileSystem is a <a href="http://www.lua.org">Lua</a> library 43developed to complement the set of functions related to file
42developed to complement the set of functions related to file systems offered 44systems offered by the standard Lua distribution.</p>
43by the standard Lua distribution. 45
44<p> 46<p>LuaFileSystem is free software and uses the same <a href=
45LuaFileSystem is free software and uses the same 47"license.html">license</a> as Lua 5.0.</p>
46<a href="license.html">license</a>
47as Lua 5.0.
48</p>
49 48
49<a name="reference"></a>
50 50
51<a name="reference"></a>
52<h2>Reference</h2> 51<h2>Reference</h2>
53 52
54<p> 53<p>LuaFileSystem offers the following functions:</p>
55LuaFileSystem offers the following functions:
56<ul>
57 <a name="attributes"></a>
58 <li> <b><tt>lfs.attributes (filepath)</tt></b> <br>
59 Obtains the file attributes.
60 The attributes are:
61 <ul>
62 <i>dev</i>, device inode resides on;<br>
63 <i>ino</i>, inode's number;<br>
64 <i>mode</i>, inode protection mode (<small>values could be
65 <tt>file</tt>, <tt>directory</tt>, <tt>link</tt>, <tt>socket</tt>, <tt>named pipe</tt>, <tt>char device</tt>, <tt>block device</tt> or <tt>other</tt></small>);<br>
66 <i>nlink</i>, number of hard links to the file;<br>
67 <i>uid</i>, user-id of owner;<br>
68 <i>gid</i>, group-id of owner;<br>
69 <i>rdev</i>, device type, for special file inode;<br>
70 <i>access</i>, time of last access;<br>
71 <i>modification</i>, time of last data modification;<br>
72 <i>change</i>, time of last file status change;<br>
73 <i>size</i>, file size, in bytes;<br>
74 <i>blocks</i>, block allocated for file; (Unix only)<br>
75 <i>blksize</i>, optimal file system I/O blocksize; (Unix only)<br>
76 </ul>
77 Returns a table with file attributes described above.
78
79 <a name="chdir"></a>
80 <li> <b><tt>lfs.chdir (path)</tt></b> <br>
81 Changes the current working directory to the given <tt>path</tt>.<br>
82 Returns <tt>true</tt> in case of success or <tt>nil</tt> plus an error
83 string.
84
85 <a name="getcwd"></a>
86 <li> <b><tt>lfs.currentdir ()</tt></b> <br>
87 Returns a string with the current working directory or
88 <code>nil</code> plus an error string.
89
90 <a name="dir"></a>
91 <li> <b><tt>lfs.dir (path)</tt></b> <br>
92 Lua iterator over the entries of a given directory.
93 Raises an error if <tt>path</tt> is not a directory.
94
95 <a name="lock"></a>
96 <li> <b><tt>lfs.lock (filehandle, mode[, start[, length]])</tt></b> <br>
97 Locks a file or a part of it.
98 This function works on <em>open files</em>;
99 the file handle should be specified as the first argument.
100 The string <code>mode</code> could be either <code>r</code> (for a
101 read/shared lock) or <code>w</code> (for a write/exclusive lock).
102 The optional arguments <code>start</code> and <code>length</code> can be
103 used to specify a starting point and its length;
104 both should be numbers.<br>
105 Returns a boolean indicating if the operation was successful;
106 in case of error, it returns <code>false</code> plus an error string.
107
108 <a name="mkdir"></a>
109 <li> <b><tt>lfs.mkdir (dirname)</tt></b> <br>
110 Creates a new directory.
111 The argument is the name of the new directory.<br>
112 Returns a boolean indicating whether the operation succeeds or not
113 (in this case, an error string is returned too).
114
115 <a name="unlock"></a>
116 <li> <b><tt>lfs.unlock (filehandle[, start[, length]])</tt></b> <br>
117 Unlocks a file or a part of it.
118 This function works on <em>open files</em>;
119 the file handle should be specified as the first argument.
120 The optional arguments <code>start</code> and <code>length</code> can be
121 used to specify a starting point and its length;
122 both should be numbers.<br>
123 Returns a boolean indicating if the operation was successful;
124 in case of error, it returns <code>false</code> plus a string describing the
125 error.
126 54
55<ul>
56<li style="list-style: none"><a name="attributes"></a></li>
57
58<li><b><tt>lfs.attributes (filepath)</tt></b><br>
59 Obtains the file attributes. The attributes are:
60
61<div style="margin-left: 2em"><i>dev</i>, device inode resides
62on;<br>
63 <i>ino</i>, inode's number;<br>
64 <i>mode</i>, inode protection mode (<small>values could be
65<tt>file</tt>, <tt>directory</tt>, <tt>link</tt>, <tt>socket</tt>,
66<tt>named pipe</tt>, <tt>char device</tt>, <tt>block device</tt> or
67<tt>other</tt></small>);<br>
68 <i>nlink</i>, number of hard links to the file;<br>
69 <i>uid</i>, user-id of owner;<br>
70 <i>gid</i>, group-id of owner;<br>
71 <i>rdev</i>, device type, for special file inode;<br>
72 <i>access</i>, time of last access;<br>
73 <i>modification</i>, time of last data modification;<br>
74 <i>change</i>, time of last file status change;<br>
75 <i>size</i>, file size, in bytes;<br>
76 <i>blocks</i>, block allocated for file; (Unix only)<br>
77 <i>blksize</i>, optimal file system I/O blocksize; (Unix only)<br>
78</div>
79
80Returns a table with file attributes described above. <a name=
81"chdir"></a></li>
82
83<li><b><tt>lfs.chdir (path)</tt></b><br>
84 Changes the current working directory to the given
85<tt>path</tt>.<br>
86 Returns <tt>true</tt> in case of success or <tt>nil</tt> plus an
87error string. <a name="getcwd"></a></li>
88
89<li><b><tt>lfs.currentdir ()</tt></b><br>
90 Returns a string with the current working directory or
91<code>nil</code> plus an error string. <a name="dir"></a></li>
92
93<li><b><tt>lfs.dir (path)</tt></b><br>
94 Lua iterator over the entries of a given directory. Raises an
95error if <tt>path</tt> is not a directory. <a name="lock"></a></li>
96
97<li><b><tt>lfs.lock (filehandle, mode[, start[,
98length]])</tt></b><br>
99 Locks a file or a part of it. This function works on <em>open
100files</em>; the file handle should be specified as the first
101argument. The string <code>mode</code> could be either
102<code>r</code> (for a read/shared lock) or <code>w</code> (for a
103write/exclusive lock). The optional arguments <code>start</code>
104and <code>length</code> can be used to specify a starting point and
105its length; both should be numbers.<br>
106 Returns a boolean indicating if the operation was successful; in
107case of error, it returns <code>false</code> plus an error string.
108<a name="mkdir"></a></li>
109
110<li><b><tt>lfs.mkdir (dirname)</tt></b><br>
111 Creates a new directory. The argument is the name of the new
112directory.<br>
113 Returns a boolean indicating whether the operation succeeds or not
114(in this case, an error string is returned too). <a name=
115"unlock"></a></li>
116
117<li><b><tt>lfs.unlock (filehandle[, start[, length]])</tt></b><br>
118 Unlocks a file or a part of it. This function works on <em>open
119files</em>; the file handle should be specified as the first
120argument. The optional arguments <code>start</code> and
121<code>length</code> can be used to specify a starting point and its
122length; both should be numbers.<br>
123 Returns a boolean indicating if the operation was successful; in
124case of error, it returns <code>false</code> plus a string
125describing the error.</li>
127</ul> 126</ul>
128 127
128<a name="example"></a>
129 129
130<a name="example"></a>
131<h2>Example</h2> 130<h2>Example</h2>
132 131
133<pre> 132<pre>
@@ -154,39 +153,45 @@ end
154attrdir (".") 153attrdir (".")
155</pre> 154</pre>
156 155
156<a name="contents"></a>
157 157
158<a name="contents"></a>
159<h2>Contents</h2> 158<h2>Contents</h2>
160<p> 159
160<ul>
161<li><a href="#introduction">Introduction</a></li>
162
163<li><a href="#reference">Reference</a>
164
161<ul> 165<ul>
162 <li> <a href="#introduction">Introduction</a> 166<li><a href="#chdir">chdir</a></li>
163 <li> <a href="#reference">Reference</a> 167
164 <ul> 168<li><a href="#currentdir">currentdir</a></li>
165 <li> <a href="#chdir">chdir</a> 169
166 <li> <a href="#currentdir">currentdir</a> 170<li><a href="#dir">dir</a></li>
167 <li> <a href="#dir">dir</a> 171
168 <li> <a href="#lock">lock</a> 172<li><a href="#lock">lock</a></li>
169 <li> <a href="#mkdir">mkdir</a> 173
170 <li> <a href="#unlock">unlock</a> 174<li><a href="#mkdir">mkdir</a></li>
171 </ul> 175
172 <li> <a href="#examples">Examples</a> 176<li><a href="#unlock">unlock</a></li>
173</ul> 177</ul>
174</p> 178</li>
175 179
180<li><a href="#examples">Examples</a></li>
181</ul>
176 182
177<p> 183<br>
178<center><small> 184<br>
179<a href="index.html">home</a> &middot; 185
180<a href="#introduction">introduction</a> &middot;
181<a href="#reference">reference</a> &middot;
182<a href="#example">example</a>
183</small></center>
184<p>
185 186
186<hr> 187<center><small><a href="index.html">home</a> &middot; <a href=
187<small> 188"#introduction">introduction</a> &middot; <a href=
188$Id: manual.html,v 1.7 2004/11/10 14:09:45 tuler Exp $ 189"#reference">reference</a> &middot; <a href=
189</small> 190"#example">example</a></small></center>
190 191
192<hr>
193<small>$Id: manual.html,v 1.7 2004/11/10 14:09:45 tuler Exp
194$</small>
191</body> 195</body>
192</html> 196</html>
197