Closed xml-project closed 4 years ago
About 4:
Assume you're trying to copy (source) directory /something/x/
to (target) /something/y/
. Wouldn't it make sense that a directory /something/y/x/
is created, including the full file/sub-directory structure of the source underneath?
As Achim said, that's one of two plausible expectations. Error means we don't have to choose one :-)
We agree on this:
Assume you're trying to copy (source) directory
/something/x/
to (target)/something/y/
. Wouldn't it make sense that a directory/something/y/x/
is created, including the full file/sub-directory structure of the source underneath?
Resolved for p:file-copy, but still open for p:file-move. See #354
Here is why I think somebody else should step in:
Suppose
a b
- x -a
- y* -v
- z* -y
-z
With overwrite = "true" b is:
b
-a
-x
-v
-y*
-z*
And a does not exist anymore.
Now with overwrite="false" this has to be an error, because of y and z. So the state of a and b after p:file-move will be
a b
-y* -a
-z* -x
-v
-y
-z
Right? And this is exactly what I fail to describe.
If a
and b
are files, move a b
is the same as delete b; rename a b
.
If a
is a file and b
is a folder, I think we decided that we would try to be consistent with what filesystems do. In this case move a b
is the same as delete b/a; rename a b/a
.
I think that should be true if a
is a folder as well.
Does that help?
(By the way, I'm happy to help write it, but I think we're still trying to clarify what the actual semantics are. There's no way to write prose we'll all agree with if we have different interpretations of what we should be describing!)
But then the semantic of overwrite is different for p:file-move and p:file-copy would be very different.
For overwrite = false it would be:
if (exists(b)) then error else delete b; rename a b.
If it is only this, I would opt to leave "overwrite" out for p:file-move because this can be done with XProc is alone in an effective way.
(By the way, I'm happy to help write it, but I think we're still trying to clarify what the actual semantics are. There's no way to write prose we'll all agree with if we have different interpretations of what we should be describing!)
Thanks.
[I numbered the single aspects, so it is easier to comment on single points.]
Was I able to make my points? Did I miss something?