[SAGA-RG] Semantics of NSEntry.move() ?
Andre Merzky
andre at merzky.net
Mon Oct 5 11:58:38 CDT 2009
Hi Mathijs,
Quoting [Mathijs den Burger] (Sep 30 2009):
>
> Hi all,
>
> The notes of ns_entry.move(saga::url target) say:
>
> - an identical copy exists at target
> - the original entry is removed
>
> The postcondition of ns_entry.remove() says:
>
> the original entry is closed and removed
>
> Does this imply that ns_entry.move() also closes the original ns_entry?
> The spec is a bit vague here...
Yes, that is indeed somewhat vague, I'll try to clarify.
For now: no, the semantics of remove() is not used by mopve(), in
particular the entry stays open.
What basically is supposed to happen is:
// prepare:
// # rm -rf /tmp/t1
// # rm -rf /tmp/t2
// # ls > /tmp/t1
saga::name_space::directory d ("file://localhost/tmp/");
saga::name_space::entry e = d.open ("t1");
assert ( d.exists ("t1") );
assert ( ! d.exists ("t2") );
std::cout << e.get_url () << " : " << e.get_size () << std::endl;
e.move ("t2", Overwrite);
std::cout << e.get_url () << " : " << e.get_size () << std::endl;
assert ( ! d.exists ("t1") );
assert ( d.exists ("t2") );
this should print
file://localhost/tmp/t1 : 1234
file://localhost/tmp/t2 : 1234
and the asserts should pass. In particular, the entry 'e' stays
open and is in a valid state.
Does that make sense? As said, I'll try to clarify that in the
spec.
Cheers, Andre.
> -Mathijs
--
Nothing is ever easy.
More information about the saga-rg
mailing list