【发布时间】:2013-06-10 04:07:32
【问题描述】:
我已经使用以下命令安装了 LuaFileSystem:luarocks install luafilesystem。现在我想在我的脚本中使用它,但我收到了这个错误:
[splay.sandbox] W: 要求 lfs 被拒绝 10:34:11.65(6)[splay.events] E:线程:0x93f0b20 DIE(错误:[字符串“作业代码”]:35:尝试索引本地“lfs”(一个零值)) 10:34:11.65 (6) [splay.events] E:堆栈回溯: 10:34:11.65(6)[字符串“工作代码”]:35:在函数'getHomeDirectory'中 10:34:11.65 (6) [string "job code"]:79: 在函数
我尝试将其声明为全局:lfs = require"lfs",或者只需要"lfs",甚至在函数中声明为局部:
function getHomeDirectory(position)
local lfs = require"lfs"
print(lfs.currentdir())
end
但我仍然得到那个错误。我还需要做些什么才能让它发挥作用?
稍后编辑:尝试使用 io 打开文件时出现与“零值”相同的错误:
local f = io.open('/home/alex/Desktop/SPLAY WORK/splay_client_commands_1.4/test1.txt', "r")
[splay.events] E: thread: 0x955f4c0 DIE (error: [string "job code"]:120: 尝试索引本地 'f' (一个 nil 值))
可能是什么问题?
【问题讨论】:
标签: lua ubuntu-10.04