]> git.e2factory.org Git - e2factory.git/commitdiff
Remove unused e2lib.read_all() and fix documentation
authorTobias Ulmer <tu@emlix.com>
Fri, 18 Jan 2013 18:31:29 +0000 (19:31 +0100)
committerTobias Ulmer <tu@emlix.com>
Tue, 26 Feb 2013 18:07:13 +0000 (19:07 +0100)
Signed-off-by: Tobias Ulmer <tu@emlix.com>
generic/e2lib.lua

index c20a9fde4341e6ce2954c96ba4b50a9694870115..eef209c55480537679c157431f101f1203b83689 100644 (file)
@@ -745,17 +745,10 @@ function e2lib.howtounpack(physpath, virtpath, destdir)
     return tool, toolargv
 end
 
--- Input/Output operations
---
---   read_line(PATHNAME)
---
---     Reads a single line from the given file and returns it.
---
---   read_all(FD, [BLOCKSIZE]) -> STRING
---
---     Reads all remaining input from a given file-descriptor. BLOCKSIZE
---     specifies the size of subsequently read blocks and defaults to 1024.
-
+--- Read the first line from the given file and return it.
+-- @param path Path to file (string).
+-- @return The first line or nil on error.
+-- @return Error object on failure.
 function e2lib.read_line(path)
     local f, msg = io.open(path)
     if not f then
@@ -769,19 +762,6 @@ function e2lib.read_line(path)
     return l
 end
 
-function e2lib.read_all(fd, blocksize)
-    local input = {}
-    local blocksize = blocksize or 1024
-    while true do
-        local s, msg = e2util.read(fd, blocksize)
-        if not s then e2lib.bomb("read error: ", msg)
-        elseif #s == 0 then break
-        else table.insert(input, s) end
-    end
-    return table.concat(input)
-end
-
-
 -- Iterators
 --
 -- These iterators are convenience functions for use in "for" statements.