pkulchenko / ZeroBraneStudio

Lightweight Lua-based IDE for Lua with code completion, syntax highlighting, live coding, remote debugger, and code analyzer; supports Lua 5.1, 5.2, 5.3, 5.4, LuaJIT and other Lua interpreters on Windows, macOS, and Linux
http://studio.zerobrane.com/
Other
2.61k stars 519 forks source link

result from lfs.lua not the same between run and debug #1080

Closed robertlzj closed 4 years ago

robertlzj commented 4 years ago

When run script lfs.attributes.access (time) get float number. When debug (Lua 5.3) get integer number. Also, some field in attributes is not the same. access will change, each time when access symbolic link of source folder.

path='E:\\F'
attributes=lfs.attributes(path)
print(attributes.access,attributes.change)

--[[
  --debug
  1599873779    1599823882

  --run
  1599877188.0  1599823882.0
]]
robertlzj commented 4 years ago

The result of lfs.symlinkattributes(path) and lfs.attributes(path) is totally different in run mode and debug mode for symlink file. lfs.symlinkattributes should return property of symlink self which mode=='link', lfs.attributes should return property of the source which mode='file' etc.

path=[[G:\S.txt]]
attributes=lfs.attributes(path)
symlinkattributes=lfs.symlinkattributes(path)
print(attributes.mode,symlinkattributes.mode)
--[[
debug: file link
run: file   file
]]

The result of debug one is correct. Does lfs conflict with IDE things in run mode?

robertlzj commented 4 years ago

I found the problem! package.cpath is different in run mode and debug mode. In run mode, there is C:\Users\XXX\luaplus\Tools\JamPlus\bin\win32\lua\modules\?.dll; at the front, which has lfs.dll of an old version.