aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Melnichenko <mpeterval@gmail.com>2016-05-04 18:25:06 +0300
committerPeter Melnichenko <mpeterval@gmail.com>2016-05-04 18:25:06 +0300
commit03e01ff9538a54be9f6b9ad85b5c95ddcc404c4c (patch)
treec4134cfe7eba72d9851d2047e2a42686470a0ad6
parent37895218387123444d84f94cb5f9a28c09ff47a0 (diff)
downloadluafilesystem-03e01ff9538a54be9f6b9ad85b5c95ddcc404c4c.tar.gz
luafilesystem-03e01ff9538a54be9f6b9ad85b5c95ddcc404c4c.tar.bz2
luafilesystem-03e01ff9538a54be9f6b9ad85b5c95ddcc404c4c.zip
Document passing table as second argument to lfs.attributes
-rw-r--r--doc/us/manual.html7
-rw-r--r--src/lfs.c2
2 files changed, 5 insertions, 4 deletions
diff --git a/doc/us/manual.html b/doc/us/manual.html
index 7a92f58..86c3406 100644
--- a/doc/us/manual.html
+++ b/doc/us/manual.html
@@ -102,14 +102,15 @@ LuaFileSystem offers the following functions:
102</p> 102</p>
103 103
104<dl class="reference"> 104<dl class="reference">
105 <dt><a name="attributes"></a><strong><code>lfs.attributes (filepath [, aname])</code></strong></dt> 105 <dt><a name="attributes"></a><strong><code>lfs.attributes (filepath [, aname | atable])</code></strong></dt>
106 <dd>Returns a table with the file attributes corresponding to 106 <dd>Returns a table with the file attributes corresponding to
107 <code>filepath</code> (or <code>nil</code> followed by an error message 107 <code>filepath</code> (or <code>nil</code> followed by an error message
108 in case of error). 108 in case of error).
109 If the second optional argument is given, then only the value of the 109 If the second optional argument is given and is a string, then only the value of the
110 named attribute is returned (this use is equivalent to 110 named attribute is returned (this use is equivalent to
111 <code>lfs.attributes(filepath).aname</code>, but the table is not created 111 <code>lfs.attributes(filepath)[aname]</code>, but the table is not created
112 and only one attribute is retrieved from the O.S.). 112 and only one attribute is retrieved from the O.S.).
113 if a table is passed as the second argument, it is filled with attributes and returned instead of a new table.
113 The attributes are described as follows; 114 The attributes are described as follows;
114 attribute <code>mode</code> is a string, all the others are numbers, 115 attribute <code>mode</code> is a string, all the others are numbers,
115 and the time related attributes use the same time reference of 116 and the time related attributes use the same time reference of
diff --git a/src/lfs.c b/src/lfs.c
index d6b55df..a35413d 100644
--- a/src/lfs.c
+++ b/src/lfs.c
@@ -4,7 +4,7 @@
4** 4**
5** File system manipulation library. 5** File system manipulation library.
6** This library offers these functions: 6** This library offers these functions:
7** lfs.attributes (filepath [, attributename]) 7** lfs.attributes (filepath [, attributename | attributetable])
8** lfs.chdir (path) 8** lfs.chdir (path)
9** lfs.currentdir () 9** lfs.currentdir ()
10** lfs.dir (path) 10** lfs.dir (path)