diff options
Diffstat (limited to 'server-beta/src/files.lua')
-rw-r--r-- | server-beta/src/files.lua | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/server-beta/src/files.lua b/server-beta/src/files.lua index 1a1cf347..6c0d8dae 100644 --- a/server-beta/src/files.lua +++ b/server-beta/src/files.lua @@ -31,6 +31,15 @@ function m.close(uri) m.openMap[uri] = nil end +--- 是否存在 +---@return boolean +function m.exists(uri) + if platform.OS == 'Windows' then + uri = uri:lower() + end + return m.fileMap[uri] ~= nil +end + --- 设置文件文本 ---@param uri string ---@param text string |