thats because int is signed but the filesize is unsigned int
what you need to do is divide it by 1024 and then recalculate its "real" value so it will be back in the positive. (this means divide the maximum neg number by 1024 as well as add the difference to that to the maximum positive number / 1024
what you need to do is divide it by 1024 and then recalculate its "real" value so it will be back in the positive. (this means divide the maximum neg number by 1024 as well as add the difference to that to the maximum positive number / 1024