I've been writing the control panel program for my OS, and I was making a general information tab inside the control panel, and one of the functions of the general info tab was to display:
> space remaining
> total space used
> total size of system folder, apps folder, and user folder.
I decided the test the API by going into the lua program in CraftOS and entering:
fs.getSize("/") – supposed to return the size of the entire drive
But when I enter this into the program it returns "0" when I know for a fact it's not 0 bytes because I have 128kb work of files in there.
Full code:
local default = 5242880
local size = fs.getSize("/")
local result = default - size
return result
It then returns the default size because it's not subtracting the difference (it's subtracting "0" because fs.getSize("/") is returning "0")
Any recommendations are gladly accepted!
Thank you for your time reading this!