1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2024-06-25 22:53:22 +00:00
CC-Tweaked/src/main/resources/data/computercraft/lua/rom/programs/type.lua
2020-11-04 14:03:08 +00:00

18 lines
370 B
Lua

local tArgs = { ... }
if #tArgs < 1 then
local programName = arg[0] or fs.getName(shell.getRunningProgram())
print("Usage: " .. programName .. " <path>")
return
end
local sPath = shell.resolve(tArgs[1])
if fs.exists(sPath) then
if fs.isDir(sPath) then
print("directory")
else
print("file")
end
else
print("No such path")
end