From 03e01ff9538a54be9f6b9ad85b5c95ddcc404c4c Mon Sep 17 00:00:00 2001 From: Peter Melnichenko Date: Wed, 4 May 2016 18:25:06 +0300 Subject: Document passing table as second argument to lfs.attributes --- doc/us/manual.html | 7 ++++--- src/lfs.c | 2 +- 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:

-
lfs.attributes (filepath [, aname])
+
lfs.attributes (filepath [, aname | atable])
Returns a table with the file attributes corresponding to filepath (or nil 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 - lfs.attributes(filepath).aname, but the table is not created + lfs.attributes(filepath)[aname], 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 mode is a string, all the others are numbers, 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 @@ ** ** 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) -- cgit v1.2.3-55-g6feb