Advertisement
Guest User

Untitled

a guest
Dec 8th, 2014
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local fs = require("filesystem")
  2.  
  3. local file = ...
  4.  
  5. size = fs.size(file)
  6. pre=""
  7. if size >= 1024 then
  8.  size = size / 1024
  9.  size = tostring(size)
  10.  local point = size:find(".")
  11.  if point ~= nil then
  12.   size=size:sub(1,point+2)
  13.  end
  14.  local pre="kilo"
  15.  size=tonumber(size)
  16. end
  17. print("File size of " .. file .. " is " .. size .. " ".. pre .." bytes.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement