【发布时间】:2019-08-09 07:30:24
【问题描述】:
如果我有这个代码
local f = io.open("../web/", "r")
print(io.type(f))
-- output: file
我如何知道f 是否指向目录?
【问题讨论】:
-
我很确定
f在那里会为零,因为尝试使用 io.open 打开目录应该返回nil和类似error opening "../web/": is a directory的字符串(在 Windows 上我得到../web/: Permission denied)
标签: lua