Question about filesystem


(acQu) #1

Hi,

i have a question for some of the engine coders or just people who know. I tried to find the answer myself, but i fear there is something i am missing.

So i try to determine the length of a random file within my directory structure. What i am worried about is getting different file lengths out of my file length requests on the different OS’s, when i do a file length request in ET. For example i have the file ui/main.menu. If i request the file length of this file on my Windows 7, 64bit, i get length 3665. Can you confirm this ?

Now how is it on Linux ? Do you get a different value there ??


(jaybird) #2

The file length it returns is in bytes, regardless of OS.


(jaybird) #3

Just a side note, remember to malloc one more byte than the file length and set that last position to (char)0 so you don’t buffer overrun :slight_smile:


(acQu) #4

Aha :slight_smile:

Well, i wouldn’t use malloc at all anyway, because trap_FS_FOpenFile is enough for what i want to do. Remember i just want to know the file size.

Thanks for answer though :penguin: