mirror of
https://github.com/awesomeWM/awesome
synced 2024-11-17 07:47:41 +01:00
refactor(awful: util): use lgi.Gio for is_dir
This commit is contained in:
parent
58a6cdb440
commit
14f7d20d0f
1 changed files with 1 additions and 10 deletions
|
@ -253,16 +253,7 @@ end
|
|||
-- @tparam string path
|
||||
-- @treturn bool True if path exists and is a directory.
|
||||
function util.is_dir(path)
|
||||
local file = io.open(path)
|
||||
if file then
|
||||
if not file:read(0) -- Not a regular file (might include empty ones).
|
||||
and file:seek("end") ~= 0 then -- And not a file with size 0.
|
||||
io.close(file)
|
||||
return true
|
||||
end
|
||||
io.close(file)
|
||||
end
|
||||
return false
|
||||
return Gio.File.new_for_path(path):query_file_type({}) == "DIRECTORY"
|
||||
end
|
||||
|
||||
local function subset_mask_apply(mask, set)
|
||||
|
|
Loading…
Reference in a new issue