Signed-off-by: Gordon Hecker <gh@emlix.com>
NEXT:
* use sha1 module instead of calling the sha1sum tool
+ * optimization: use stat() instead of calling 'test -f'
e2factory-2.3.2
* temporary build directories are located in a version specific directory
-- @param dir string: path
-- @return bool
function e2lib.isfile(path)
- local args = string.format("-f '%s'", path)
- return e2lib.call_tool("test", args)
+ local t = e2util.stat(path, true)
+ if not t or t.type ~= "regular" then
+ return false
+ end
+ return true
end
--- check if path is a file