[SAGA-RG] Some more questions

Andre Merzky andre at merzky.net
Tue Oct 30 10:12:53 CDT 2007


Hi Ceriel, Roelof, 

Quoting [Ceriel Jacobs] (Oct 30 2007):
> 
> Hi Andre,
> 
> Roelof Kemp came up with some questions/remarks on the ns_entry copy method:
> 
> 1. The specs mention that a DoesNotExist exception is thrown when the
>    target lies in a non-existing part of the name space. However,
>    DoesNotExist is not listed in the "Throws" list.

Right, thanks.


> 2. What is supposed to happen when the source is a directory, the
>    recursive flag is set, and the target is a file? I assume remove
>    target, create target dir, and copy? And if overwrite flag is
>    not set, throw AlreadyExists?

Uhm, tough one!  Unix shell would say:

  koks merzky /tmp : mkdir a
  koks merzky /tmp : touch a/a b
  koks merzky /tmp : cp -Rf a b
  cp: cannot overwrite non-directory `b' with directory `a'

We don't have an exception for this.  So, yes, I would
concur with your interpretation: the target file should get
removed, and a target dir with the same name should get
created.

> 3. What is supposed to happen with a recursive copy where the overwrite
>    flag is NOT set, and some of the destinations already exist? Copy to
>    the non-existing destinations and throw AlreadyExists?

Puh, no idea!  The POSIX C API has no recursive directory
copy, and the POSIX shells have no notion of overwrite flags
(only of !overwrite -- -f/--force has a slightly
different meaning).  

I agree that your interpretation seems the most logical one,
but I would assume that it would make sense not to make any
assumptions on what files got copied before the exception
gets raised.  Also, the exception should name the target
entry causing the trouble.


> Also, could you give Roelof access to the SAGA CVS?

read access should be publicly available - let me know if
there is trouble.  I'd be really happy to give write access
as well (active contributors are _really_ hard to find...),
but I would also appreciate to know what his plans for
writing the are :-)  

Cheers, Andre.

> Cheers,	Ceriel



-- 
No trees were destroyed in the sending of this message, however,
a significant number of electrons were terribly inconvenienced.


More information about the saga-rg mailing list