fixing lfs.lock_dir on windows to return "File exists" instead of looping, plus

documenting lfs.lock_dir
This commit is contained in:
mascarenhas
2009-04-24 22:24:06 +00:00
parent b80d2baacc
commit c1eff3de6b
2 changed files with 20 additions and 5 deletions

View File

@@ -171,6 +171,16 @@ LuaFileSystem offers the following functions:
<code>path</code>.<br />
Returns <code>true</code> in case of success or <code>nil</code> plus an
error string.</dd>
<dt><a name="chdir"></a><strong><code>lfs.lock_dir(path, [seconds_stale])</code></strong></dt>
<dd>Creates a lockfile (called lockfile.lfs) in <code>path</code> if it does not
exist and returns the lock. If the lock already exists checks it
it's stale, using the second parameter (default for the second
parameter is <code>INT_MAX</code>, which in practice means the lock will never
be stale. To free the the lock call <code>lock:free()</code>. <br/>
In case of any errors it returns nil and the error message. In
particular, if the lock exists and is not stale it returns the
"File exists" message.</dd>
<dt><a name="getcwd"></a><strong><code>lfs.currentdir ()</code></strong></dt>
<dd>Returns a string with the current working directory or <code>nil</code>
@@ -251,7 +261,7 @@ LuaFileSystem offers the following functions:
<div id="about">
<p><a href="http://validator.w3.org/check?uri=referer">Valid XHTML 1.0!</a></p>
<p><small>$Id: manual.html,v 1.43 2008/05/08 18:45:15 carregal Exp $</small></p>
<p><small>$Id: manual.html,v 1.44 2009/04/24 22:24:06 mascarenhas Exp $</small></p>
</div> <!-- id="about" -->
</div> <!-- id="container" -->