luafilesystem icon indicating copy to clipboard operation
luafilesystem copied to clipboard

error when retrieve symlinkatrributes at directory symlink

Open robertlzj opened this issue 2 years ago • 1 comments

Hi,

local lfs=require'lfs'
print(lfs._VERSION)--1.8.0
local file1,file2='test_directory','symlink-directory'
assert(not lfs.attributes(file1) and not  lfs.attributes(file2))
lfs.mkdir(file1)
lfs.link(file1,file2,true)
assert(lfs.symlinkattributes(file2,'target')=="Input/output error")--should be path
assert(not pcall(lfs.symlinkattributes,file2))--should not raise error 'attempt to index a nil value'
return 

works correct on file.

Windows 10 x64

robertlzj avatar May 12 '22 12:05 robertlzj

Same. I don't know if it's intended but target field only exists on broken symlinks.

cevhyruz avatar Jun 08 '23 15:06 cevhyruz