summaryrefslogtreecommitdiff
path: root/xmake/core/base/io.lua
diff options
context:
space:
mode:
authorOpportunityLiu <[email protected]>2019-07-02 10:12:56 +0800
committerOpportunityLiu <[email protected]>2019-07-02 10:12:56 +0800
commit0261c0e50b59980f08cd8185bf2fb84e7248d104 (patch)
treea7135a6534029e6fd89b4681fe9bf76c950f0775 /xmake/core/base/io.lua
parent35dbc87a2c7e36e8cd3d6e81acd84ff3d5542ba8 (diff)
add some check
Diffstat (limited to 'xmake/core/base/io.lua')
-rw-r--r--xmake/core/base/io.lua5
1 files changed, 4 insertions, 1 deletions
diff --git a/xmake/core/base/io.lua b/xmake/core/base/io.lua
index e3f6b153d..a6a2105a3 100644
--- a/xmake/core/base/io.lua
+++ b/xmake/core/base/io.lua
@@ -32,11 +32,13 @@ io._open = io._open or io.open
_file._read = _file._read or _file.read
+-- read data from file
function _file:read(fmt, opt)
opt = opt or {}
return self:_read(fmt, opt.continuation)
end
+-- read all lines from a file
function _file:lines(opt)
opt = opt or {}
@@ -76,7 +78,7 @@ function _file:load()
end
end
--- read all data from file
+-- read all lines from file
function io.lines(filepath, opt)
opt = opt or {}
@@ -95,6 +97,7 @@ function io.lines(filepath, opt)
return file:lines(opt)
end
+-- read all data from file
function io.readfile(filepath, opt)
opt = opt or {}