有没有一种方法可以使用lua命令require来加载luafilesystem?

我一直在尝试安装API,但它不起作用。 一直收到这个错误

stdin:1: module 'Desktop/luafilesystem-master' not found:
no field package.preload['Desktop/luafilesystem-master']
no file '/usr/local/share/lua/5.3/Desktop/luafilesystem-master.lua'
no file '/usr/local/share/lua/5.3/Desktop/luafilesystem-master/init.lua'
no file '/usr/local/lib/lua/5.3/Desktop/luafilesystem-master.lua'
no file '/usr/local/lib/lua/5.3/Desktop/luafilesystem-master/init.lua'
no file './Desktop/luafilesystem-master.lua'
no file './Desktop/luafilesystem-master/init.lua'
no file '/usr/local/lib/lua/5.3/Desktop/luafilesystem-master.so'
no file '/usr/local/lib/lua/5.3/loadall.so'
no file './Desktop/luafilesystem-master.so'
stack traceback:
[C]: in function 'require'
stdin:1: in main chunk
[C]: in ?

同时,我无法安装luarocks,我只需要它成为一个独立的程序,以便它是临时安装的,可以移植。

点赞
用户1442917
用户1442917

你好像将模块命名为 Desktop/luafilesystem-master,但是在大多数情况下,应该是 require "lfs",并且你需要在错误信息中列出的路径之一中有 lfs.so 文件。

如果你是从源代码进行编译,那么编译的结果将是 lfs.so 文件,你需要将它放在其中一个位置。

2017-03-10 17:00:51