diff options
author | NiteHawk <n1tehawk@users.noreply.github.com> | 2016-07-16 15:35:27 +0200 |
---|---|---|
committer | NiteHawk <n1tehawk@users.noreply.github.com> | 2016-07-16 15:35:27 +0200 |
commit | 32b355a9902e6ce7aae68926fc3f2d05856fc299 (patch) | |
tree | ffcda689b162126d3793a1f0b62ab05eec287250 /tests | |
parent | 080f74f785b2f30708ae797c15fca95a418b028a (diff) | |
download | luafilesystem-32b355a9902e6ce7aae68926fc3f2d05856fc299.tar.gz luafilesystem-32b355a9902e6ce7aae68926fc3f2d05856fc299.tar.bz2 luafilesystem-32b355a9902e6ce7aae68926fc3f2d05856fc299.zip |
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.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test.lua | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/test.lua b/tests/test.lua index 2842bc0..2331eec 100644 --- a/tests/test.lua +++ b/tests/test.lua | |||
@@ -91,6 +91,8 @@ io.flush() | |||
91 | if lfs.link (tmpfile, "_a_link_for_test_", true) then | 91 | if lfs.link (tmpfile, "_a_link_for_test_", true) then |
92 | assert (lfs.attributes"_a_link_for_test_".mode == "file") | 92 | assert (lfs.attributes"_a_link_for_test_".mode == "file") |
93 | assert (lfs.symlinkattributes"_a_link_for_test_".mode == "link") | 93 | assert (lfs.symlinkattributes"_a_link_for_test_".mode == "link") |
94 | assert (lfs.symlinkattributes"_a_link_for_test_".target == tmpfile) | ||
95 | assert (lfs.symlinkattributes("_a_link_for_test_", "target") == tmpfile) | ||
94 | assert (lfs.link (tmpfile, "_a_hard_link_for_test_")) | 96 | assert (lfs.link (tmpfile, "_a_hard_link_for_test_")) |
95 | assert (lfs.attributes (tmpfile, "nlink") == 2) | 97 | assert (lfs.attributes (tmpfile, "nlink") == 2) |
96 | assert (os.remove"_a_link_for_test_") | 98 | assert (os.remove"_a_link_for_test_") |