| 函数名称 | 文件.判断句柄 | |||
|---|---|---|---|---|
| 函数功能 | 判断句柄 | |||
| 函数语法 | 文件.判断句柄(file) | |||
| 英语语法 | WJ.PDJB(file) | |||
| 参数说明 | 参数 | 类型 | 必填 | 说明 |
| num | userdata | 是 | 需要判断的文件句柄 | |
| 返回值 | 有 | string | 1. 一个打开的文件句柄,”closed file“ - 为一个已关闭的文件句柄,nil - 不是文件句柄 | |
| 注意事项 |
函数用例:
file,msg = io.open("/mnt/sdcard/kazhu.txt",r)bool = 文件.判断句柄(file)if bool == "file" thendialog("是文件句柄",5)elseif bool == "closed file" thendialog("句柄已关闭",5)elseif bool == nil thendialog("不是文件句柄",5)end
