minio / mc

Unix like utilities for object store
https://min.io/download
GNU Affero General Public License v3.0
2.86k stars 548 forks source link

Copies from wrong folder #4740

Closed d07RiV closed 1 year ago

d07RiV commented 1 year ago

Run mc cp -r webp/ <bucket>/ from .../data folder.

Expected behavior

Copy contents of .../data/webp folder to bucket

Actual behavior

Progress bar shows files from a different folder:

...\data\webp3\<...>.webp: 32.84 MiB / 69.92 MiB [===

It seems to consider data/webp3 to be a subfolder of data/webp?

Steps to reproduce the behavior

Have two folders, second folder's name starts with first folder name.

mc --version

mc version RELEASE.2023-04-12T02-21-51Z (commit-id=1843717c57fb87612469b7610344a7d49d97a497) Runtime: go1.20.3 windows/amd64 Copyright (c) 2015-2023 MinIO, Inc. License GNU AGPLv3 https://www.gnu.org/licenses/agpl-3.0.html

System information

klauspost commented 1 year ago

S3 path matches are prefix based.

d07RiV commented 3 weeks ago

I'm sorry there's no way it's reasonable behavior to upload a file named webpc.js when I'm trying to upload webp/ folder. S3 path matches are one thing, but what does that have to do with my Windows file system?

zveinn commented 3 weeks ago

It has nothing to do with your file system.

mc cp is not unix cp even though it exhibits some traits of unix cp.

mc cp is designed to operate in a flexible manner.. s3 to s3, s3 to local, local to s3. Because of this all sources are considered prefix based.

so /home/user/data/webp is considered a prefix. therefor /home/user/data/webp3 is withing that prefix