forked from chudongjingling/open_code
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
00da6c9
commit 5301918
Showing
1 changed file
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
function writeEEFile(str,path,mode) --写入文件内容,路径,类型,默认路径企业版目录 scriptData/playLog.text 下,自定义路径请把 \ 改为 /。默认类型追加,覆盖第三个参数写 "wb" | ||
mode = mode or "a" | ||
local telib = require("ts_enterprise_lib") | ||
assert(telib,"无法引入企业专用库") | ||
if path==nil then | ||
local ok,msg = telib:controller_injection( | ||
[[ | ||
require("lfs").mkdir("scriptData") | ||
local f = io.open("scriptData/playLog.text","a") | ||
if f then | ||
f:write("]]..str..[[\r\n") | ||
f:close() | ||
end | ||
]] | ||
) | ||
else | ||
local ok,msg = telib:controller_injection( | ||
[[ | ||
local f = io.open("]]..path..[[","]]..mode..[[") | ||
if f then | ||
f:write("]]..str..[[\r\n") | ||
f:close() | ||
end | ||
]] | ||
) | ||
end | ||
end |