Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mv adds additional subfolder when subfolder exists #1787

Open
boraberke opened this issue Jun 10, 2024 · 0 comments
Open

mv adds additional subfolder when subfolder exists #1787

boraberke opened this issue Jun 10, 2024 · 0 comments

Comments

@boraberke
Copy link

When mv is used to move a file between buckets, it behaves differently depending on whether a subfolder with the same name exists.

Reproducing steps

  1. Create two buckets, test-bucket and test-bucket-2.
  2. Create a temp file in your local dir.
touch 12345.txt
  1. Copy the file to test-bucket with the following subfolders.
gsutil cp 12345.txt gs://test-bucket/folder/nested_folder/aaaa/bbbb/cccc/12345.txt 
  1. Move file to test-bucket-2.
gsutil -m mv gs://test-bucket/folder/nested_folder gs://test-bucket-2/folder/nested_folder
  1. Check the contents of test-bucket-2.
gsutil ls "gs://test-bucket-2/folder/nested_folder/**"

First Output should be as follows:

gs://test-bucket-2/folder/nested_folder/aaaa/bbbb/cccc/12345.txt
  1. Repeat the step 3, 4 and 5. Check that output of step 5 included a secondary nested_folder in it.
gs://test-bucket-2/folder/nested_folder/aaaa/bbbb/cccc/12345.txt
gs://test-bucket-2/folder/nested_folder/nested_folder/aaaa/bbbb/cccc/12345.txt

I am not sure if this is an expected behavior but same command producing two different results depending on the bucket structure does not feel right.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant