Posted By: Kartoffel
file_length() incorrect values - 04/30/18 16:21
file_length() seems to give incorrect results when it's used for larger files (a couple of megabytes or higher).
Here's a code example of how I used it:
What's interesting is that manually retrieving it using the engine's functions seems to give the same faulty results.
Here's a code example of how I used it:
Code:
var fhandle = file_open_read("test.mp3"); var Size = file_length(fhandle); printf("size: %d", (int)Size); file_close(fhandle);
What's interesting is that manually retrieving it using the engine's functions seems to give the same faulty results.
Code:
file_seek(fhandle, 0, 2); // seek to end int Size = (int)file_seek(fhandle, 0, 4); // read position file_seek(fhandle, 0, 1); // seek back to beginning