Advertisement
Guest User

File data tool by Big SHiny Toys

a guest
Sep 3rd, 2012
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.88 KB | None | 0 0
  1. --[[
  2.         file infomation tool
  3.         by BigSHinyToys
  4.         vre 0.1 build 1
  5. ]]--
  6. local tArgs = {...}
  7. if #tArgs ~= 1 then
  8.     print("usage <fils parth and name>")
  9.     return
  10. end
  11. print("-----Infomation------")
  12. if fs.exists(tArgs[1]) then
  13.     if not fs.isDir(tArgs[1]) then
  14.         print("Name : "..fs.getName(tArgs[1]))
  15.         local sizBytes = fs.getSize(tArgs[1])
  16.         local one,two = math.modf(sizBytes/1024)
  17.         print("Size : "..tostring(one).."."..string.sub(tostring(two),3,4).." KB ("..sizBytes.." bytes )")
  18.         local where = fs.getDrive(tArgs[1])
  19.         if where == "hdd" or where == "rom" then
  20.             print("Location : "..where)
  21.         else
  22.             print("Location : "..where.." disk drive")
  23.         end
  24.         if fs.isReadOnly(tArgs[1]) then
  25.             print("File is read only")
  26.         else
  27.             print([[Read / write enabled]])
  28.         end
  29.     else
  30.         print("This is a directory")
  31.     end
  32. else
  33.     print("Not file or Folder")
  34. end
  35. print("---------------------")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement