]> git.e2factory.org Git - e2factory.git/commitdiff
new external tool: rmdir
authorGordon Hecker <gh@emlix.com>
Thu, 24 Sep 2009 12:30:30 +0000 (14:30 +0200)
committerGordon Hecker <gh@emlix.com>
Fri, 2 Oct 2009 10:40:08 +0000 (12:40 +0200)
Signed-off-by: Gordon Hecker <gh@emlix.com>
generic/e2lib.lua
generic/transport.lua

index 3b3de4c675e3c1b3583735837d7deefec1be7330..7a61953735e35c7b0c0976245e53681331c55810 100644 (file)
@@ -1411,6 +1411,19 @@ function e2lib.touch(file, flags)
   return e2lib.call_tool("touch", args)
 end
 
+--- call the rmdir command
+-- @param dir string: the directory name
+-- @param flags string: flags to pass to rmdir
+-- @return bool
+-- @return the last line ouf captured output
+function e2lib.rmdir(dir, flags)
+       if not flags then
+               flags = ""
+       end
+       local args = string.format("%s %s", flags, dir)
+       return e2lib.call_tool("rmdir", args)
+end
+
 --- call the mkdir command
 -- @param dir string: the directory name
 -- @param flags string: flags to pass to mkdir
index 6c40ece4a7255d4815639f26bfa2fcb6e61960f1..6be5654ca74082a414fd594649fe7f144cdb7671 100644 (file)
@@ -39,6 +39,7 @@ local tools = {
        mktemp = { name = "mktemp", flags = "", optional = false },
        rm = { name = "rm", flags = "", optional = false },
        mkdir = { name = "mkdir", flags = "", optional = false },
+       rmdir = { name = "rmdir", flags = "", optional = false },
        cp = { name = "cp", flags = "", optional = false },
        ln = { name = "ln", flags = "", optional = false },
        mv = { name = "mv", flags = "", optional = false },