[Scummvm-devel] Missing File::exists() on many ports, making SAGA games unplayable

Max Horn max at quendi.de
Sat Jan 19 01:32:56 CET 2008


Am 18.01.2008 um 19:23 schrieb Marcus Comstedt:

>
> Filippos K <philipk79 at hotmail.com> writes:
>
>> This is mostly aimed for porters
>> The way that fs-node checked for file existence (i.e File::exists 
>> () ) was done
>> in a very weird and hackish way. David Corrales did very nice work  
>> on the
>> beast that's the filesystem node, however a quite serious problem  
>> arose.
>> As it is now, File::exists() is a stub in most of the ports that  
>> ScummVM runs
>> under. That means that it ALWAYS returns true in many ports,  
>> regardless if the
>> file in question exists or not.  [...]
>
>
> Ok, I'm confused.
>
> Previously, there was a method isValid(), which was implemented on
> all ports (AFAIK), and which returned true if the node was "valid",
> i.e. represented an existing file.  Now, this working function has
> been removed and replaced by a non-working (albeit better named)
> stub exists().  Is there some subtle difference between the semantics
> of this "exists()" and the old isValid(), or why wasn't simply the
> working implementation renamed?

Well, isValid() was never very well-defined. It originally was meant  
to indicate "this node describes a valid *path*", which in no way  
implies that it actually points to an existing file (or directory).  
Then at some point it was changed to the semantics of the current  
"exists()", but not in all ports, and it was not used consistently  
like that.

Hence, it was not possible to simply blindly copy over the code of  
existing implementations. Instead, we requirer porters to fill these  
gaps. Which may very well be possible by copying the old code for the  
old isValid() method. Or not.


Cheers,
Max




More information about the Scummvm-devel mailing list