summaryrefslogtreecommitdiff
path: root/xmake/core/base/io.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2019-07-10 22:21:23 +0800
committerruki <[email protected]>2019-07-10 08:08:23 +0800
commitd08ce22527736b59691d26810405961483d68c29 (patch)
treec791070f8a690e221ecb241010bccdb4d1f5a1cd /xmake/core/base/io.lua
parent635a192a0422ba5fcfcf69ef28e25297d649b708 (diff)
read binary lua file
Diffstat (limited to 'xmake/core/base/io.lua')
-rw-r--r--xmake/core/base/io.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/xmake/core/base/io.lua b/xmake/core/base/io.lua
index 59d1b5d6a..114a7a00c 100644
--- a/xmake/core/base/io.lua
+++ b/xmake/core/base/io.lua
@@ -174,7 +174,7 @@ function io.open(filepath, mode, opt)
opt = opt or {}
-- open it
- local handle = io._open(path.translate(filepath), mode .. (opt.encoding or ""))
+ local handle = io._open(filepath, mode .. (opt.encoding or ""))
if not handle then
return nil, string.format("failed to open %s", filepath)
end
@@ -203,7 +203,7 @@ function io.save(filepath, object, opt)
end
-- open the file
- local file = io.open(filepath, "w", opt)
+ local file = io.open(filepath, "wb", opt)
if not file then
-- error
return false, string.format("open %s failed!", filepath)
@@ -233,7 +233,7 @@ function io.load(filepath, opt)
opt = opt or {}
-- open the file
- local file = io.open(filepath, "r", opt)
+ local file = io.open(filepath, "rb", opt)
if not file then
-- error
return nil, string.format("open %s failed!", filepath)