mirror of
https://github.com/lunarmodules/luafilesystem.git
synced 2026-07-22 02:53:06 +00:00
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:
@@ -91,6 +91,8 @@ io.flush()
|
||||
if lfs.link (tmpfile, "_a_link_for_test_", true) then
|
||||
assert (lfs.attributes"_a_link_for_test_".mode == "file")
|
||||
assert (lfs.symlinkattributes"_a_link_for_test_".mode == "link")
|
||||
assert (lfs.symlinkattributes"_a_link_for_test_".target == tmpfile)
|
||||
assert (lfs.symlinkattributes("_a_link_for_test_", "target") == tmpfile)
|
||||
assert (lfs.link (tmpfile, "_a_hard_link_for_test_"))
|
||||
assert (lfs.attributes (tmpfile, "nlink") == 2)
|
||||
assert (os.remove"_a_link_for_test_")
|
||||
|
||||
Reference in New Issue
Block a user