newlist

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::
io.exists

测试文件是否存在,如果存在返回 true。

格式:

result = io.exists(路径)
可以使用 CCFileUtils:fullPathForFilename() 函数查找特定文件的完整路径,例如:

local path = CCFileUtils:sharedFileUtils():fullPathForFilename("gamedata.txt")
if io.exists(path) then
    ....
end

 

posted on 2014-04-06 21:29  一枚程序  阅读(1707)  评论(0编辑  收藏  举报