Add a 'target' field for symlinkattributes.

It returns the resolved path of the symlink.

Original version by Hisham <hisham@gobolinux.org>, modified to
use a different strategy for sizing the readlink() buffer.
This commit is contained in:
NiteHawk
2016-07-16 15:35:27 +02:00
parent 080f74f785
commit 32b355a990
3 changed files with 52 additions and 1 deletions

View File

@@ -242,6 +242,8 @@ LuaFileSystem offers the following functions:
<dt><a name="symlinkattributes"></a><strong><code>lfs.symlinkattributes (filepath [, aname])</code></strong></dt>
<dd>Identical to <a href="#attributes">lfs.attributes</a> except that
it obtains information about the link itself (not the file it refers to).
It also adds a <strong><code>target</code></strong> field, containing
the file name that the symlink points to.
On Windows this function does not yet support links, and is identical to
<code>lfs.attributes</code>.
</dd>