mirror of
https://github.com/etlegacy/wolfadmin.git
synced 2024-11-24 21:21:56 +00:00
Added files.exists function used in b2c357b03f
This commit is contained in:
parent
b2c357b03f
commit
2d1c7a22f4
1 changed files with 12 additions and 0 deletions
|
@ -36,6 +36,18 @@ function files.ls(directory)
|
||||||
return entries
|
return entries
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function files.exists(fileName)
|
||||||
|
local fileDescriptor, fileLength = et.trap_FS_FOpenFile(fileName, et.FS_READ)
|
||||||
|
|
||||||
|
if fileLength ~= -1 then
|
||||||
|
et.trap_FS_FCloseFile(fileDescriptor)
|
||||||
|
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
function files.loadFromCFG(fileName, idExpr)
|
function files.loadFromCFG(fileName, idExpr)
|
||||||
local fileDescriptor, fileLength = et.trap_FS_FOpenFile(fileName, et.FS_READ)
|
local fileDescriptor, fileLength = et.trap_FS_FOpenFile(fileName, et.FS_READ)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue