The user FTP repled that the executable are here ==> https://github.com/luapower/lfs but there is no mention of how to install this.
Can you provide information on how to make this library usable
I want to execute something like the following
Code: Select all
require "lfs"
function dirtree(dir)
assert(dir and dir ~= "", "directory parameter is missing or empty")
if string.sub(dir, -1) == "/" then
dir=string.sub(dir, 1, -2)
end
local function yieldtree(dir)
for entry in lfs.dir(dir) do
if entry ~= "." and entry ~= ".." then
entry=dir.."/"..entry
local attr=lfs.attributes(entry)
coroutine.yield(entry,attr)
if attr.mode == "directory" then
yieldtree(entry)
end
end
end
end
return coroutine.wrap(function() yieldtree(dir) end)
end
-- example
for filename, attr in dirtree("/FTP/FTP-Repo/") do
print(attr.mode, filename)
end
lua>> dofile("/root/Test/try1.lua")
some error in /root/Test/try1.lua:1: module 'lfs' not found:
no field package.preload['lfs']
no file './lfs.lua'
no file '/usr/local/share/lua/5.1/lfs.lua'
no file '/usr/local/share/lua/5.1/lfs/init.lua'
no file '/usr/local/lib/lua/5.1/lfs.lua'
no file '/usr/local/lib/lua/5.1/lfs/init.lua'
no file '/usr/share/lua/5.1/lfs.lua'
no file '/usr/share/lua/5.1/lfs/init.lua'
no file '/wftpserver//lua/lfs.lua'
no file './lfs.so'
no file '/usr/local/lib/lua/5.1/lfs.so'
no file '/usr/lib/x86_64-linux-gnu/lua/5.1/lfs.so'
no file '/usr/lib/lua/5.1/lfs.so'
no file '/usr/local/lib/lua/5.1/loadall.so'!
How do I install this library unto my existing Wing FTP server ?