Replies: 3 comments 8 replies
-
There is one wrinkle that we did not discuss: What should happen when there are multiple sources specified on the command-line. Anyway… For the case:
I believe the result should be I do not see anything else in the table that needs changing. === Then, the summary of this all almost becomes:
I say almost because we have a concession to the common practice of "copy a singular file/object to this already existing local directory (that tab-completion filled in for me)": If the left argument is a Pelican object, and the right argument is an already existing directory, we treat the right argument as if the user had appended the object's basename to it. The converse of this case, where the left argument is a local file, and the right argument maps to a POSIX directory behind the Pelican origin, is, in the table, flagged as an error. The lack of symmetry is perhaps unappealing, but in the former case, the user knows that the destination is a POSIX filesystem and thus knows how it behaves. It is a whole separate can of worms to specify and enforce a POSIX-compatible scheme on object names. |
Beta Was this translation helpful? Give feedback.
-
@brianaydemir @bbockelm Updated the table and added a line on multiple sources. |
Beta Was this translation helpful? Give feedback.
-
Ran into one case I don't think we can easily solve:
Our current code sees that If the This actually is in line with what we expect |
Beta Was this translation helpful? Give feedback.
-
What follows is a table showing what we want as the appropriate behavior for various types of uses of
pelican sync
andpelican get/put --recursive
@bbockelm @brianaydemir Please double check to make sure I got every case correct.pelican obj sync pelican://foo/bar /tmp/test
pelican obj sync pelican://foo/bar /tmp/test
/tmp/test/baz.txt
foo/bar
prefix into thetmp/test
folderpelican obj sync pelican://foo/bar /tmp/test
/tmp/test/baz.txt
/tmp/test
folder and puts the objects with thefoo/bar
prefix into thetmp/test
folderpelican obj sync pelican::/foo/bar.txt /tmp/test
tmp/test/bar.txt
tmp/test
directorypelican obj sync pelican::/foo/bar.txt /tmp/test
tmp/test/
foo/bar.txt
intotmp/test
and createstest
pelican obj sync pelican::/foo/bar.txt /tmp/test
/tmp/test
foo/bar.txt
as/tmp/test
pelican obj sync /tmp/test pelican://foo/bar
pelican://foo/bar/baz.txt
/temp/test/
at/foo/bar
, creating namespace prefixes as neededpelican obj sync /tmp/test.txt pelican://foo/bar.txt
pelican obj sync /tmp/test.txt pelican://foo/bar.txt
pelican::/foo/bar.txt
bar.txt
is an object, overwrite the filepelican obj sync /tmp/test.txt pelican://foo/bar.txt
pelican::foo/bar.txt
When there are multiple sources specified on the command-line, we will iterate over each source and treat each one according to the table above.
Beta Was this translation helpful? Give feedback.
All reactions