Document passing table as second argument to lfs.attributes

This commit is contained in:
Peter Melnichenko
2016-05-04 18:25:06 +03:00
parent 3789521838
commit 03e01ff953
2 changed files with 5 additions and 4 deletions

View File

@@ -102,14 +102,15 @@ LuaFileSystem offers the following functions:
</p>
<dl class="reference">
<dt><a name="attributes"></a><strong><code>lfs.attributes (filepath [, aname])</code></strong></dt>
<dt><a name="attributes"></a><strong><code>lfs.attributes (filepath [, aname | atable])</code></strong></dt>
<dd>Returns a table with the file attributes corresponding to
<code>filepath</code> (or <code>nil</code> followed by an error message
in case of error).
If the second optional argument is given, then only the value of the
If the second optional argument is given and is a string, then only the value of the
named attribute is returned (this use is equivalent to
<code>lfs.attributes(filepath).aname</code>, but the table is not created
<code>lfs.attributes(filepath)[aname]</code>, but the table is not created
and only one attribute is retrieved from the O.S.).
if a table is passed as the second argument, it is filled with attributes and returned instead of a new table.
The attributes are described as follows;
attribute <code>mode</code> is a string, all the others are numbers,
and the time related attributes use the same time reference of

View File

@@ -4,7 +4,7 @@
**
** File system manipulation library.
** This library offers these functions:
** lfs.attributes (filepath [, attributename])
** lfs.attributes (filepath [, attributename | attributetable])
** lfs.chdir (path)
** lfs.currentdir ()
** lfs.dir (path)