I use the workaround stat = posix.stat("/var/cache/man") if not stat then domkdir = true elseif not (stat.type == "directory") then domkdir = true os.remove("/var/cache/man") end seems to work