
Mathijs den Burger wrote:
Hi all,
The specification of the constructor of ns_entry confuses me a bit. What happens if the provided URL points to an existing directory?
At page 205, the SAGA spec says: - the default flags are ’None’ (0) - the constructor performs an open of the entry - all notes to the respective open call (on namespace_directory) apply.
But at page 233, the first note of ns_directory.open() says: - a ’BadParameter’ exception is thrown if ’name’ points to a directory, or is an invalid entry name.
Together, these notes imply that the constructor of ns_entry should throw a 'BadParameter' exception if it gets a URL that points to a directory. The Java SAGA implementation of the Vrije Universiteit indeed checks this case explicitly. I'm not sure what the other implementations do.
However, if no ns_entry object can point to a directory, the method ns_entry.is_dir() will always return false and is therefore pointless.
No, it is not. An ns_directory is also an ns_entry, and it may (should) redefine the is_dir() method. And an ns_entry object CAN point to a directory, but in that case it is an ns_directory object.
Either way, the spec seems to contain an inconsistency... Or am I missing something?
I don't see the inconsistency. Am I missing something :-? Ceriel