diff options
| author | uid20002 <uid20002> | 2005-05-19 20:24:31 +0000 |
|---|---|---|
| committer | uid20002 <uid20002> | 2005-05-19 20:24:31 +0000 |
| commit | 8774e2caae458a39fdc1e9a72fdae6fa05ae1104 (patch) | |
| tree | 90cb3bd33b5c58864db3a6f51a9fa2ca61280d4a | |
| parent | e8e69b98f568081e04cacc3575d66f7f38df753f (diff) | |
| download | luafilesystem-8774e2caae458a39fdc1e9a72fdae6fa05ae1104.tar.gz luafilesystem-8774e2caae458a39fdc1e9a72fdae6fa05ae1104.tar.bz2 luafilesystem-8774e2caae458a39fdc1e9a72fdae6fa05ae1104.zip | |
Documentation update
| -rw-r--r-- | doc/us/examples.html | 9 | ||||
| -rw-r--r-- | doc/us/index.html | 12 | ||||
| -rw-r--r-- | doc/us/manual.html | 212 |
3 files changed, 125 insertions, 108 deletions
diff --git a/doc/us/examples.html b/doc/us/examples.html index 63a3f93..57eefbe 100644 --- a/doc/us/examples.html +++ b/doc/us/examples.html | |||
| @@ -48,7 +48,12 @@ | |||
| 48 | 48 | ||
| 49 | <div id="content"> | 49 | <div id="content"> |
| 50 | 50 | ||
| 51 | <h2><a name="example"></a>Example</h2> | 51 | <h2><a name="example"></a>Examples</h2> |
| 52 | |||
| 53 | <h3>Directory iterator</h3> | ||
| 54 | |||
| 55 | <p>The following example iterates over a directory and recursively lists the | ||
| 56 | attributes for each file or directory inside it.</p> | ||
| 52 | 57 | ||
| 53 | <pre class="example"> | 58 | <pre class="example"> |
| 54 | require"lfs" | 59 | require"lfs" |
| @@ -81,7 +86,7 @@ attrdir (".") | |||
| 81 | <div id="about"> | 86 | <div id="about"> |
| 82 | <p><a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0!" height="31" width="88" /></a></p> | 87 | <p><a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0!" height="31" width="88" /></a></p> |
| 83 | <p><small> | 88 | <p><small> |
| 84 | $Id: examples.html,v 1.1 2005/05/04 02:28:51 tuler Exp $ | 89 | $Id: examples.html,v 1.2 2005/05/19 20:24:31 uid20002 Exp $ |
| 85 | </small></p> | 90 | </small></p> |
| 86 | </div> <!-- id="about" --> | 91 | </div> <!-- id="about" --> |
| 87 | 92 | ||
diff --git a/doc/us/index.html b/doc/us/index.html index b7e6983..440182c 100644 --- a/doc/us/index.html +++ b/doc/us/index.html | |||
| @@ -83,12 +83,14 @@ page. | |||
| 83 | <h2><a name="history"></a>History</h2> | 83 | <h2><a name="history"></a>History</h2> |
| 84 | 84 | ||
| 85 | <ul> | 85 | <ul> |
| 86 | <li>[?/?/2005] Version 1.1 released</li> | 86 | <li>[19/May/2005] Version 1.1 released<br /> |
| 87 | <li>[21/Jan/2005] Version 1.0 released</li> | 87 | added function <code>lfs.touch</code>. |
| 88 | <li>[10/Nov/2004] Version 1.0 beta released</li> | 88 | </li> |
| 89 | <li>[21/Jan/2005] Version 1.0 released</li> | ||
| 90 | <li>[10/Nov/2004] Version 1.0 beta released</li> | ||
| 89 | </ul> | 91 | </ul> |
| 90 | 92 | ||
| 91 | Version 1.1 adds function <tt>lfs.touch</tt>. | 93 | |
| 92 | 94 | ||
| 93 | <h2><a name="credits"></a>Credits</h2> | 95 | <h2><a name="credits"></a>Credits</h2> |
| 94 | 96 | ||
| @@ -110,7 +112,7 @@ Comments are welcome!</p> | |||
| 110 | <div id="about"> | 112 | <div id="about"> |
| 111 | <p><a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0!" height="31" width="88" /></a></p> | 113 | <p><a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0!" height="31" width="88" /></a></p> |
| 112 | <p><small> | 114 | <p><small> |
| 113 | $Id: index.html,v 1.11 2005/05/04 02:28:51 tuler Exp $ | 115 | $Id: index.html,v 1.12 2005/05/19 20:24:31 uid20002 Exp $ |
| 114 | </small></p> | 116 | </small></p> |
| 115 | </div> <!-- id="about" --> | 117 | </div> <!-- id="about" --> |
| 116 | 118 | ||
diff --git a/doc/us/manual.html b/doc/us/manual.html index 770b913..205e3f4 100644 --- a/doc/us/manual.html +++ b/doc/us/manual.html | |||
| @@ -15,7 +15,7 @@ | |||
| 15 | <div id="product_logo"><a href="http://www.keplerproject.org"> | 15 | <div id="product_logo"><a href="http://www.keplerproject.org"> |
| 16 | <img alt="LuaFileSystem" src="luafilesystem.png"/> | 16 | <img alt="LuaFileSystem" src="luafilesystem.png"/> |
| 17 | </a></div> | 17 | </a></div> |
| 18 | <div id="product_name"><big><b>LuaFileSystem</b></big></div> | 18 | <div id="product_name"><big><strong>LuaFileSystem</strong></big></div> |
| 19 | <div id="product_description">File System Library for the Lua Programming Language</div> | 19 | <div id="product_description">File System Library for the Lua Programming Language</div> |
| 20 | </div> <!-- id="product" --> | 20 | </div> <!-- id="product" --> |
| 21 | 21 | ||
| @@ -61,8 +61,8 @@ systems offered by the standard Lua distribution.</p> | |||
| 61 | 61 | ||
| 62 | <p> | 62 | <p> |
| 63 | LuaFileSystem is distributed as a pair of C source and header | 63 | LuaFileSystem is distributed as a pair of C source and header |
| 64 | files. The distribution provides a <tt>Makefile</tt> prepared to | 64 | files. The distribution provides a <code>Makefile</code> prepared to |
| 65 | compile the library and install it. The file <tt>config</tt> should | 65 | compile the library and install it. The file <code>config</code> should |
| 66 | be edited to suit the needs of the aimed platform. | 66 | be edited to suit the needs of the aimed platform. |
| 67 | </p> | 67 | </p> |
| 68 | 68 | ||
| @@ -71,109 +71,119 @@ LuaFileSystem follows the | |||
| 71 | <a href="http://www.keplerproject.org/compat">package proposal</a> | 71 | <a href="http://www.keplerproject.org/compat">package proposal</a> |
| 72 | for Lua 5.1, therefore this package should be "installed". | 72 | for Lua 5.1, therefore this package should be "installed". |
| 73 | In other words, | 73 | In other words, |
| 74 | if you are using Lua 5.0, the files <tt>compat-5.1.c</tt> and | 74 | if you are using Lua 5.0, the files <code>compat-5.1.c</code> and |
| 75 | <tt>compat-5.1.h</tt> must be used in the compilation and the file | 75 | <code>compat-5.1.h</code> must be used in the compilation and the file |
| 76 | <tt>compat-5.1.lua</tt> must be installed in the <tt>LUA_PATH</tt>. | 76 | <code>compat-5.1.lua</code> must be installed in the <code>LUA_PATH</code>. |
| 77 | If you are using Lua 5.1, nothing should be done.</p> | 77 | If you are using Lua 5.1, nothing should be done.</p> |
| 78 | 78 | ||
| 79 | <h2><a name="reference"></a>Reference</h2> | 79 | <h2><a name="reference"></a>Reference</h2> |
| 80 | 80 | ||
| 81 | <p>LuaFileSystem offers the following functions:</p> | 81 | <p>LuaFileSystem offers the following functions:</p> |
| 82 | 82 | ||
| 83 | <ul> | 83 | <dl> |
| 84 | <a name="attributes"></a> | 84 | <dt><a name="attributes"></a><strong><code>lfs.attributes (filepath)</code></strong></dt> |
| 85 | <li><b><tt>lfs.attributes (filepath)</tt></b><br> | 85 | <dd>Returns a table with the file attributes corresponding to <code>filepath</code>. |
| 86 | Obtains the file attributes. The attributes are: | 86 | The attributes are: |
| 87 | 87 | <dl> | |
| 88 | <div style="margin-left: 2em"><i>dev</i>, device inode resides | 88 | <dt><strong><code>dev</code></strong></dt> |
| 89 | on;<br> | 89 | <dd>device that the inode resides on</dd> |
| 90 | <i>ino</i>, inode's number;<br> | 90 | |
| 91 | <i>mode</i>, inode protection mode (<small>values could be | 91 | <dt><strong><code>ino</code></strong></dt> |
| 92 | <tt>file</tt>, <tt>directory</tt>, <tt>link</tt>, <tt>socket</tt>, | 92 | <dd>inode's number</dd> |
| 93 | <tt>named pipe</tt>, <tt>char device</tt>, <tt>block device</tt> or | 93 | |
| 94 | <tt>other</tt></small>);<br> | 94 | <dt><strong><code>mode</code></strong></dt> |
| 95 | <i>nlink</i>, number of hard links to the file;<br> | 95 | <dd>inode protection mode (string, values could be <code>file</code>, |
| 96 | <i>uid</i>, user-id of owner;<br> | 96 | <code>directory</code>, <code>link</code>, <code>socket</code>, |
| 97 | <i>gid</i>, group-id of owner;<br> | 97 | <code>named pipe</code>, <code>char device</code>, <code>block device</code> or |
| 98 | <i>rdev</i>, device type, for special file inode;<br> | 98 | <code>other</code>)</dd> |
| 99 | <i>access</i>, time of last access;<br> | 99 | |
| 100 | <i>modification</i>, time of last data modification;<br> | 100 | <dt><strong><code>nlink</code></strong></dt> |
| 101 | <i>change</i>, time of last file status change;<br> | 101 | <dd>number of hard links to the file</dd> |
| 102 | <i>size</i>, file size, in bytes;<br> | 102 | |
| 103 | <i>blocks</i>, block allocated for file; (Unix only)<br> | 103 | <dt><strong><code>uid</code></strong></dt> |
| 104 | <i>blksize</i>, optimal file system I/O blocksize; (Unix only)<br> | 104 | <dd>user-id of owner</dd |
| 105 | </div> | 105 | |
| 106 | 106 | <dt><strong><code>gid</code></strong></dt> | |
| 107 | Returns a table with file attributes described above. | 107 | <dd>group-id of owner</dd> |
| 108 | </li> | 108 | |
| 109 | 109 | <dt><strong><code>rdev</code></strong></dt> | |
| 110 | <a name="chdir"></a> | 110 | <dd>device type, for special file inode</dd> |
| 111 | <li><b><tt>lfs.chdir (path)</tt></b><br> | 111 | |
| 112 | Changes the current working directory to the given | 112 | <dt><strong><code>access</code></strong></dt> |
| 113 | <tt>path</tt>.<br> | 113 | <dd>time of last access</dd> |
| 114 | Returns <tt>true</tt> in case of success or <tt>nil</tt> plus an | 114 | |
| 115 | error string. | 115 | <dt><strong><code>modification</code></strong></dt> |
| 116 | </li> | 116 | <dd>time of last data modification</dd> |
| 117 | 117 | ||
| 118 | <a name="getcwd"></a> | 118 | <dt><strong><code>change</code></strong></dt> |
| 119 | <li><b><tt>lfs.currentdir ()</tt></b><br> | 119 | <dd>time of last file status change</dd> |
| 120 | Returns a string with the current working directory or | 120 | |
| 121 | <code>nil</code> plus an error string. | 121 | <dt><strong><code>size</code></strong></dt> |
| 122 | </li> | 122 | <dd>file size, in bytes</dd> |
| 123 | 123 | ||
| 124 | <a name="dir"></a> | 124 | <dt><strong><code>blocks</code></strong></dt> |
| 125 | <li><b><tt>lfs.dir (path)</tt></b><br> | 125 | <dd>block allocated for file; (Unix only)</dd> |
| 126 | Lua iterator over the entries of a given directory. Raises an | 126 | |
| 127 | error if <tt>path</tt> is not a directory. | 127 | <dt><strong><code>blksize</code></strong></dt> |
| 128 | </li> | 128 | <dd>optimal file system I/O blocksize; (Unix only)</dd> |
| 129 | 129 | </dl> | |
| 130 | <a name="lock"></a> | 130 | |
| 131 | <li><b><tt>lfs.lock (filehandle, mode[, start[, length]])</tt></b><br> | 131 | |
| 132 | Locks a file or a part of it. This function works on <em>open | 132 | <dt><a name="chdir"></a><strong><code>lfs.chdir (path)</code></strong></dt> |
| 133 | files</em>; the file handle should be specified as the first | 133 | <dd>Changes the current working directory to the given |
| 134 | argument. The string <code>mode</code> could be either | 134 | <code>path</code>.<br /> |
| 135 | <code>r</code> (for a read/shared lock) or <code>w</code> (for a | 135 | Returns <code>true</code> in case of success or <code>nil</code> plus an |
| 136 | write/exclusive lock). The optional arguments <code>start</code> | 136 | error string.</dd> |
| 137 | and <code>length</code> can be used to specify a starting point and | 137 | |
| 138 | its length; both should be numbers.<br> | 138 | |
| 139 | Returns a boolean indicating if the operation was successful; in | 139 | <dt><a name="getcwd"></a><strong><code>lfs.currentdir ()</code></strong></dt> |
| 140 | case of error, it returns <code>false</code> plus an error string. | 140 | <dd>Returns a string with the current working directory or <code>nil</code> |
| 141 | </li> | 141 | plus an error string.</dd> |
| 142 | 142 | ||
| 143 | <a name="mkdir"></a> | 143 | <dt><a name="dir"></a><strong><code>lfs.dir (path)</code></strong></dt> |
| 144 | <li><b><tt>lfs.mkdir (dirname)</tt></b><br> | 144 | <dd>Lua iterator over the entries of a given directory. Raises an |
| 145 | Creates a new directory. The argument is the name of the new | 145 | error if <code>path</code> is not a directory.</dd> |
| 146 | directory.<br> | 146 | |
| 147 | Returns a boolean indicating whether the operation succeeds or not | 147 | <dt><a name="lock"></a><strong><code>lfs.lock (filehandle, mode[, start[, length]])</code></strong></dt> |
| 148 | (in this case, an error string is returned too). | 148 | <dd>Locks a file or a part of it. This function works on <em>open files</em>; the |
| 149 | </li> | 149 | file handle should be specified as the first argument. |
| 150 | 150 | The string <code>mode</code> could be either | |
| 151 | <a name="touch"></a> | 151 | <code>r</code> (for a read/shared lock) or <code>w</code> (for a |
| 152 | <li><b><tt>lfs.touch (filepath [, atime [, mtime]])</tt></b><br> | 152 | write/exclusive lock). The optional arguments <code>start</code> |
| 153 | Set access and modification times of a file. | 153 | and <code>length</code> can be used to specify a starting point and |
| 154 | This function is a bind to <tt>utime</tt> function. | 154 | its length; both should be numbers.<br /> |
| 155 | The first argument is the filename, | 155 | Returns a boolean indicating if the operation was successful; in |
| 156 | the second argument is the access time, | 156 | case of error, it returns <code>false</code> plus an error string. |
| 157 | and the third argument is the modification time. | 157 | </dd> |
| 158 | Both times are provided in seconds (which should be generated with | 158 | |
| 159 | Lua standard function <tt>os.date</tt>). | 159 | <dt><a name="mkdir"></a><strong><code>lfs.mkdir (dirname)</code></strong></dt> |
| 160 | If the modifition time is omitted, the access time provided is used; | 160 | <dd>Creates a new directory. The argument is the name of the new |
| 161 | if both times are omitted, the current time is used.<br> | 161 | directory.<br /> |
| 162 | Returns a boolean indicating whethet the operation succeeds or not | 162 | Returns a boolean indicating whether the operation succeeds or not |
| 163 | (followed by an error string in case it fails). | 163 | (in this case, an error string is returned too).</dd> |
| 164 | </li> | 164 | |
| 165 | 165 | <dt><a name="touch"></a><strong><code>lfs.touch (filepath [, atime [, mtime]])</code></strong></dt> | |
| 166 | <a name="unlock"></a> | 166 | <dd>Set access and modification times of a file. This function is |
| 167 | <li><b><tt>lfs.unlock (filehandle[, start[, length]])</tt></b><br> | 167 | a bind to <code>utime</code> function. The first argument is the |
| 168 | Unlocks a file or a part of it. This function works on <em>open | 168 | filename, the second argument is the access time, |
| 169 | files</em>; the file handle should be specified as the first | 169 | and the third argument is the modification time. |
| 170 | argument. The optional arguments <code>start</code> and | 170 | Both times are provided in seconds (which should be generated with |
| 171 | <code>length</code> can be used to specify a starting point and its | 171 | Lua standard function <code>os.date</code>). |
| 172 | length; both should be numbers.<br> | 172 | If the modifition time is omitted, the access time provided is used; |
| 173 | Returns a boolean indicating if the operation was successful; in | 173 | if both times are omitted, the current time is used.<br /> |
| 174 | case of error, it returns <code>false</code> plus a string | 174 | Returns a boolean indicating whethet the operation succeeds or not |
| 175 | describing the error.</li> | 175 | (followed by an error string in case it fails).</dd> |
| 176 | </ul> | 176 | |
| 177 | <dt><a name="unlock"></a><strong><code>lfs.unlock (filehandle[, start[, length]])</code></strong></dt> | ||
| 178 | <dd>Unlocks a file or a part of it. This function works on | ||
| 179 | <em>open files</em>; the file handle should be specified as the first | ||
| 180 | argument. The optional arguments <code>start</code> and | ||
| 181 | <code>length</code> can be used to specify a starting point and its | ||
| 182 | length; both should be numbers.<br /> | ||
| 183 | Returns a boolean indicating if the operation was successful; in | ||
| 184 | case of error, it returns <code>false</code> plus a string | ||
| 185 | describing the error.</dd> | ||
| 186 | </dl> | ||
| 177 | 187 | ||
| 178 | </div> <!-- id="content" --> | 188 | </div> <!-- id="content" --> |
| 179 | 189 | ||
| @@ -182,7 +192,7 @@ describing the error.</li> | |||
| 182 | <div id="about"> | 192 | <div id="about"> |
| 183 | <p><a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0!" height="31" width="88" /></a></p> | 193 | <p><a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0!" height="31" width="88" /></a></p> |
| 184 | <p><small> | 194 | <p><small> |
| 185 | $Id: manual.html,v 1.10 2005/05/04 02:28:51 tuler Exp $ | 195 | $Id: manual.html,v 1.11 2005/05/19 20:24:31 uid20002 Exp $ |
| 186 | </small></p> | 196 | </small></p> |
| 187 | </div> <!-- id="about" --> | 197 | </div> <!-- id="about" --> |
| 188 | 198 | ||
