mirror of
https://github.com/lunarmodules/luafilesystem.git
synced 2026-07-25 05:03:07 +00:00
Acrescimo de documentacao da lfs.touch.
Adaptacao para a versao 1.1.
This commit is contained in:
@@ -39,20 +39,14 @@ href="http://www.lua.org">Lua</a> Programming Language</td>
|
|||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="#over">Overview</a></li>
|
<li><a href="#over">Overview</a></li>
|
||||||
|
|
||||||
<li><a href="#version">Current Version</a></li>
|
<li><a href="#version">Current Version</a></li>
|
||||||
|
|
||||||
<li><a href="#download">Download</a></li>
|
<li><a href="#download">Download</a></li>
|
||||||
|
|
||||||
<li><a href="#manual">Manual</a></li>
|
<li><a href="#manual">Manual</a></li>
|
||||||
|
|
||||||
<li><a href="#credits">Credits</a></li>
|
<li><a href="#credits">Credits</a></li>
|
||||||
|
|
||||||
<li><a href="#contact">Contact us</a></li>
|
<li><a href="#contact">Contact us</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<a name="over"></a>
|
<a name="over"></a>
|
||||||
|
|
||||||
<h2>Overview</h2>
|
<h2>Overview</h2>
|
||||||
|
|
||||||
<p>LuaFileSystem is a library developed to complement the set of
|
<p>LuaFileSystem is a library developed to complement the set of
|
||||||
@@ -60,13 +54,16 @@ functions related to file systems offered by the standard Lua
|
|||||||
distribution. One of its goals is to be as portable as Lua.</p>
|
distribution. One of its goals is to be as portable as Lua.</p>
|
||||||
|
|
||||||
<p>LuaFileSystem is free software and uses the same <a href=
|
<p>LuaFileSystem is free software and uses the same <a href=
|
||||||
"license.html">license</a> as Lua 5.0. <a name="version"></a></p>
|
"license.html">license</a> as Lua 5.0.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<a name="version"></a>
|
||||||
<h2>Current version</h2>
|
<h2>Current version</h2>
|
||||||
|
|
||||||
<p>Current version is 1.0. It was developed for Lua 5.0.</p>
|
<p>Current version is 1.1.
|
||||||
|
It was developed for Lua 5.0.</p>
|
||||||
|
|
||||||
<p>Version 1.0 follows the
|
<p>Version 1.1 follows the
|
||||||
<a href="http://www.keplerproject.org/compat">package proposal</a>
|
<a href="http://www.keplerproject.org/compat">package proposal</a>
|
||||||
for Lua 5.1 (see section <a href="#installation">Installation</a>
|
for Lua 5.1 (see section <a href="#installation">Installation</a>
|
||||||
for more details).
|
for more details).
|
||||||
@@ -85,10 +82,13 @@ page.
|
|||||||
<h2>What's new</h2>
|
<h2>What's new</h2>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
|
<li>[?/?/2005] Version 1.1 released</li>
|
||||||
<li>[21/Jan/2005] Version 1.0 released</li>
|
<li>[21/Jan/2005] Version 1.0 released</li>
|
||||||
<li>[10/Nov/2004] Version 1.0 beta released</li>
|
<li>[10/Nov/2004] Version 1.0 beta released</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
Version 1.1 adds function <tt>lfs.touch</tt>.
|
||||||
|
|
||||||
<a name="installation"></a>
|
<a name="installation"></a>
|
||||||
<h2>Installation</h2>
|
<h2>Installation</h2>
|
||||||
|
|
||||||
@@ -122,7 +122,7 @@ which holds its copyright.</p>
|
|||||||
Comments are welcome!</p>
|
Comments are welcome!</p>
|
||||||
|
|
||||||
<hr>
|
<hr>
|
||||||
<small>$Id: index.html,v 1.9 2005/01/19 14:30:08 tomas Exp $</small>
|
<small>$Id: index.html,v 1.10 2005/01/24 10:59:58 tomas Exp $</small>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
||||||
|
|||||||
@@ -53,8 +53,7 @@ systems offered by the standard Lua distribution.</p>
|
|||||||
<p>LuaFileSystem offers the following functions:</p>
|
<p>LuaFileSystem offers the following functions:</p>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li style="list-style: none"><a name="attributes"></a></li>
|
<a name="attributes"></a>
|
||||||
|
|
||||||
<li><b><tt>lfs.attributes (filepath)</tt></b><br>
|
<li><b><tt>lfs.attributes (filepath)</tt></b><br>
|
||||||
Obtains the file attributes. The attributes are:
|
Obtains the file attributes. The attributes are:
|
||||||
|
|
||||||
@@ -77,25 +76,31 @@ on;<br>
|
|||||||
<i>blksize</i>, optimal file system I/O blocksize; (Unix only)<br>
|
<i>blksize</i>, optimal file system I/O blocksize; (Unix only)<br>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
Returns a table with file attributes described above. <a name=
|
Returns a table with file attributes described above.
|
||||||
"chdir"></a></li>
|
</li>
|
||||||
|
|
||||||
|
<a name="chdir"></a>
|
||||||
<li><b><tt>lfs.chdir (path)</tt></b><br>
|
<li><b><tt>lfs.chdir (path)</tt></b><br>
|
||||||
Changes the current working directory to the given
|
Changes the current working directory to the given
|
||||||
<tt>path</tt>.<br>
|
<tt>path</tt>.<br>
|
||||||
Returns <tt>true</tt> in case of success or <tt>nil</tt> plus an
|
Returns <tt>true</tt> in case of success or <tt>nil</tt> plus an
|
||||||
error string. <a name="getcwd"></a></li>
|
error string.
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<a name="getcwd"></a>
|
||||||
<li><b><tt>lfs.currentdir ()</tt></b><br>
|
<li><b><tt>lfs.currentdir ()</tt></b><br>
|
||||||
Returns a string with the current working directory or
|
Returns a string with the current working directory or
|
||||||
<code>nil</code> plus an error string. <a name="dir"></a></li>
|
<code>nil</code> plus an error string.
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<a name="dir"></a>
|
||||||
<li><b><tt>lfs.dir (path)</tt></b><br>
|
<li><b><tt>lfs.dir (path)</tt></b><br>
|
||||||
Lua iterator over the entries of a given directory. Raises an
|
Lua iterator over the entries of a given directory. Raises an
|
||||||
error if <tt>path</tt> is not a directory. <a name="lock"></a></li>
|
error if <tt>path</tt> is not a directory.
|
||||||
|
</li>
|
||||||
|
|
||||||
<li><b><tt>lfs.lock (filehandle, mode[, start[,
|
<a name="lock"></a>
|
||||||
length]])</tt></b><br>
|
<li><b><tt>lfs.lock (filehandle, mode[, start[, length]])</tt></b><br>
|
||||||
Locks a file or a part of it. This function works on <em>open
|
Locks a file or a part of it. This function works on <em>open
|
||||||
files</em>; the file handle should be specified as the first
|
files</em>; the file handle should be specified as the first
|
||||||
argument. The string <code>mode</code> could be either
|
argument. The string <code>mode</code> could be either
|
||||||
@@ -105,15 +110,32 @@ and <code>length</code> can be used to specify a starting point and
|
|||||||
its length; both should be numbers.<br>
|
its length; both should be numbers.<br>
|
||||||
Returns a boolean indicating if the operation was successful; in
|
Returns a boolean indicating if the operation was successful; in
|
||||||
case of error, it returns <code>false</code> plus an error string.
|
case of error, it returns <code>false</code> plus an error string.
|
||||||
<a name="mkdir"></a></li>
|
</li>
|
||||||
|
|
||||||
|
<a name="mkdir"></a>
|
||||||
<li><b><tt>lfs.mkdir (dirname)</tt></b><br>
|
<li><b><tt>lfs.mkdir (dirname)</tt></b><br>
|
||||||
Creates a new directory. The argument is the name of the new
|
Creates a new directory. The argument is the name of the new
|
||||||
directory.<br>
|
directory.<br>
|
||||||
Returns a boolean indicating whether the operation succeeds or not
|
Returns a boolean indicating whether the operation succeeds or not
|
||||||
(in this case, an error string is returned too). <a name=
|
(in this case, an error string is returned too).
|
||||||
"unlock"></a></li>
|
</li>
|
||||||
|
|
||||||
|
<a name="touch"></a>
|
||||||
|
<li><b><tt>lfs.touch (filepath [, atime [, mtime]])</tt></b><br>
|
||||||
|
Set access and modification times of a file.
|
||||||
|
This function is a bind to <tt>utime</tt> function.
|
||||||
|
The first argument is the filename,
|
||||||
|
the second argument is the access time,
|
||||||
|
and the third argument is the modification time.
|
||||||
|
Both times are provided in seconds (which should be generated with
|
||||||
|
Lua standard function <tt>os.date</tt>).
|
||||||
|
If the modifition time is omitted, the access time provided is used;
|
||||||
|
if both times are omitted, the current time is used.<br>
|
||||||
|
Returns a boolean indicating whethet the operation succeeds or not
|
||||||
|
(followed by an error string in case it fails).
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<a name="unlock"></a>
|
||||||
<li><b><tt>lfs.unlock (filehandle[, start[, length]])</tt></b><br>
|
<li><b><tt>lfs.unlock (filehandle[, start[, length]])</tt></b><br>
|
||||||
Unlocks a file or a part of it. This function works on <em>open
|
Unlocks a file or a part of it. This function works on <em>open
|
||||||
files</em>; the file handle should be specified as the first
|
files</em>; the file handle should be specified as the first
|
||||||
@@ -126,7 +148,6 @@ describing the error.</li>
|
|||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<a name="example"></a>
|
<a name="example"></a>
|
||||||
|
|
||||||
<h2>Example</h2>
|
<h2>Example</h2>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
|
|||||||
Reference in New Issue
Block a user