(no commit message)
[project/luci.git] / core / src / ffluci / fs.lua
index 3eb562b..0ca191b 100644 (file)
@@ -35,9 +35,9 @@ end
 
 -- Checks whether a file exists
 function isfile(filename)
-       local fp = io.open(path, "r")
-       if file then file:close() end
-       return file ~= nil
+       local fp = io.open(filename, "r")
+       if fp then fp:close() end
+       return fp ~= nil
 end    
 
 -- Returns the content of file
@@ -53,26 +53,6 @@ function readfile(filename)
        return data     
 end
 
--- Returns the content of file as array of lines
-function readfilel(filename)
-       local fp, err = io.open(filename)
-       local line = ""
-       local data = {}
-               
-       if fp == nil then
-               return nil, err
-       end
-       
-       while true do
-               line = fp:read()
-               if (line == nil) then break end
-               table.insert(data, line)
-       end     
-       
-       fp:close()
-       return data     
-end
-
 -- Writes given data to a file
 function writefile(filename, data)
        local fp, err = io.open(filename, "w")
@@ -107,5 +87,8 @@ function dir(path)
        return dir
 end
 
--- Alias for lfs.mkdir
-mkdir = posix.mkdir
\ No newline at end of file
+-- Alias for posix.mkdir
+mkdir = posix.mkdir
+
+-- Alias for posix.rmdir
+rmdir = posix.rmdir
\ No newline at end of file