This repository has been archived on 2024-04-19. You can view files and clone it, but cannot push or open issues or pull requests.
FREAX/bin/mkdir
2022-07-18 19:33:40 +02:00

18 lines
442 B
Text

local tArgs = { ... }
if #tArgs < 1 then
local programName = "mkdir"
print("Usage: " .. programName .. " <paths>")
return
end
for _, v in ipairs(tArgs) do
local sNewDir = shell.resolve(v)
if fs.exists(sNewDir) and not fs.isDir(sNewDir) then
printError(v .. ": Destination exists")
elseif fs.isReadOnly(sNewDir) then
printError(v .. ": Access denied")
else
fs.makeDir(sNewDir)
end
end