Advertisement
PaymentOption

cd For Viewer

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