Guest User

type

a guest
May 5th, 2016
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.28 KB | None | 0 0
  1.  
  2. local tArgs = { ... }
  3. if #tArgs < 1 then
  4.     print( "Usage: type <path>" )
  5.     return
  6. end
  7.  
  8. local sPath = shell.resolve( tArgs[1] )
  9. if fs.exists( sPath ) then
  10.     if fs.isDir( sPath ) then
  11.         print( "directory" )
  12.     else
  13.         print( "file" )
  14.     end
  15. else
  16.     print( "No such path" )
  17. end
Add Comment
Please, Sign In to add comment