[Scummvm-devel] ScummVM PS2 backend - to be or not to be... a directory

LavosSpawn lavosspawn at g-trans.de
Fri Feb 22 15:05:03 CET 2008


>
>>> That's definetely the bug. I made it out in an empirical way:
>>>
>>> I counted the delta between two successful 'open' fd, and counted
>>> the number of failed 'dopen' in-between. Tada! If you try to dopen
>>> a non-directory item, you lose one fd. So that ruled out my first
>>> solution to check whether a file was a dir ot not with 'dopen'.
>>>   
>>>       
What I don't understand is..
why does the backend need to provide a function for that in the first place?
I mean, we are already able to list the corresponding parent directory 
and provide flags for each element to tell if an entry is a file or 
directory.
So if the engine knows that there is an entry with the name xyz, why 
does it need to check if it's a dir or file? shouldn't it always already 
know?




More information about the Scummvm-devel mailing list