
You are right: open should be able to open entries and directories (which *are* entries). open_dir should work only for directories. Same holds then indeed for the entry and dir constructors. Thanks, Andre. Quoting [Mathijs den Burger] (Aug 11 2009):
From: Mathijs den Burger <mathijs@cs.vu.nl> To: saga-rg@ogf.org Date: Tue, 11 Aug 2009 17:55:14 +0200 Subject: [SAGA-RG] Semantics of the ns_entry constructor
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.
Either way, the spec seems to contain an inconsistency... Or am I missing something?
Mathijs -- Nothing is ever easy.