Jump to content

fileGetSize bad argument, expected scriptfile, got string


BlueTheFurry

Recommended Posts

Posted

Hello, i want to get the size of the file "test.dff", but the problem is, when i try to get it, it just throws me this error back:

"[expected scriptfile at argument 1, got string "test.dff" ]

my code:

  
local theFile = "test.dff" 
fzb = fileGetSize(theFile) 
local fz = fzb/1024 
  
  

Posted

fileGetSize takes in a file userdata variable, not a string. You need to use fileOpen first.

local theFile = fileOpen("test.dff") 
fzb = fileGetSize(theFile) 
local fz = fzb/1024 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...