summaryrefslogtreecommitdiffstats
path: root/fs.lua
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2016-08-10 15:48:23 +0000
committerTed Trask <ttrask01@yahoo.com>2016-08-10 15:48:23 +0000
commitae59e7f08b35ec98f2358b0d9526fbf822a32f01 (patch)
treeddcda801b80a1dcd3bae7ec25bf158a91af8958e /fs.lua
parent4dd2e0a349a51321a71415721072e848f2650f2b (diff)
downloadacf-lib-ae59e7f08b35ec98f2358b0d9526fbf822a32f01.tar.bz2
acf-lib-ae59e7f08b35ec98f2358b0d9526fbf822a32f01.tar.xz
Remove trailing whitespace
Diffstat (limited to 'fs.lua')
-rw-r--r--fs.lua10
1 files changed, 5 insertions, 5 deletions
diff --git a/fs.lua b/fs.lua
index 364e9fc..7f56084 100644
--- a/fs.lua
+++ b/fs.lua
@@ -127,7 +127,7 @@ function mymodule.read_file ( path )
end
end
--- Returns an array with the contents of a file,
+-- Returns an array with the contents of a file,
-- or nil and the error message
function mymodule.read_file_as_array ( path )
local file, error = io.open(path or "")
@@ -135,14 +135,14 @@ function mymodule.read_file_as_array ( path )
return nil, error
end
local f = {}
- for line in file:lines() do
+ for line in file:lines() do
table.insert ( f , line )
--sometimes you will see it like f[#f+1] = line
end
file:close()
return f
end
-
+
-- write a string to a file, will replace file contents
function mymodule.write_file ( path, str )
path = path or ""
@@ -174,7 +174,7 @@ function mymodule.find_files_as_array ( what, where, follow, t )
where = where or posix.getcwd()
what = what or ".*"
t = t or {}
-
+
local link
if follow and mymodule.is_link(where) then
link = posix.readlink(where)
@@ -209,7 +209,7 @@ end
function mymodule.find ( what, where, follow )
local t = mymodule.find_files_as_array ( what, where, follow )
local idx = 0
- return function ()
+ return function ()
idx = idx + 1
return t[idx]
end