[Saga-devel] saga SVN commit 3288: /trunk/adaptors/default/file/
Hartmut Kaiser
hkaiser at cct.lsu.edu
Thu Jan 15 10:52:47 CST 2009
> Hartmut Kaiser wrote:
> >> fs::directory_iterator dir_end = fs::directory_iterator();
> >> for (fs::directory_iterator dir_it(path); dir_it != dir_end;
> >> ++dir_it)
> >> {
> >> - //retval.push_back(host + saga::detail::leaf((*dir_it)));
> see
> >> --> Spec. p. 141
> >> - retval.push_back(saga::detail::leaf(*dir_it));
> >> + try {
> >> + //retval.push_back(host + saga::detail::leaf((*dir_it)));
> >> see --> Spec. p. 141
> >> + retval.push_back(saga::detail::leaf(*dir_it));
> >
> > Does this mean list has to return the relative paths? Hmm, I remember
> fixing
> > something like this already, but perhaps in a different adaptor...
> >
> >> + }
> >> + catch ( ... )
> >> + {
> >> + // ignore this one
> >> + SAGA_LOG_ERROR("Boost failed to handle some filename");
> >> + SAGA_LOG_ALWAYS("Boost failed to handle some filename");
> >> + }
> >
> > Why don't you rethrow a saga::exception? What causes the
> system_exception?
>
> FWIW, boost::filesystem operations usually have a no-throw counterpart
> using error codes, instead. Perhaps we should be using those instead
> of adding try-catch blocks.
If we were using only one Boost version I'ld tend to agree. But since we're trying to support older Boost versions as well, we're bound to use the try/catch constructs as those don't support the nothrow() functions. Not nice, but nothing we could do about this (except duplicating the code based on Boost versions, which seems to be even worse).
Regards Hartmut
More information about the saga-devel
mailing list