函数:os.remove 删除文件

函数名称:删除文件

函数功能:删除文件

函数方法

bool,msg = os.remove(filename)

参数 类型 必填 说明
filename string 必填 需要删除的文件路径
返回值 类型 说明
bool boolean 成功 - tue,失败 - nil
msg string 失败返回的错误信息

函数示例

bool,msg = os.remove("/mnt/sdcard/111/")
if bool then
    dialog("删除成功",5)
else
    dialog("删除失败,失败原因:"..msg,5)
end
Copyright 北京帮你玩科技有限公司 2023 all right reserved,powered by Gitbook该文章修订时间: 2024-03-06 17:50:18

results matching ""

    No results matching ""