Help Center/ Object Storage Service/ Tools Guide/ obsutil/ FAQs/ Why Is the Number of Objects I Downloaded from OBS to My Local Windows PC Different from That in OBS?
Updated on 2024-03-07 GMT+08:00

Why Is the Number of Objects I Downloaded from OBS to My Local Windows PC Different from That in OBS?

Windows does not distinguish the cases of files or folders while OBS does. For example, in Windows, FOO.txt and foo.txt are regarded as the same file, but in OBS, they are regarded as different files.

In the following example, a bucket has objects with the same name but different cases.

obsutil ls obs://test
Start at 2024-01-17 01:33:37.6378193 +0000 UTC

Listing objects .

Folder list:
obs://test/TEST/
obs://test/test/

Object list:
key                                 LastModified                  Size      StorageClass        ETag      
obs://test/TEST/FOO.txt         2024-01-17T01:33:21Z          493B      standard            "735b0ca5680bfa12d8895702662192ec"

obs://test/test/foo.txt         2024-01-17T01:32:59Z          5B        standard            "5d41402abc4b2a76b9719d911017c592"

Total size of bucket: 498B
Folder number: 2
File number: 2

Run the cp command to download all objects from this bucket to the test directory on your local Windows PC.

obsutil cp obs://test ./test -r -f

Start at 2024-01-17 01:39:40.4700311 +0000 UTC


Parallel:      5                   Jobs:          5
Threshold:     50.00MB             PartSize:      auto
VerifyLength:  false               VerifyMd5:     false
CheckpointDir: C:\Users\Administrator\.obsutil_checkpoint

Task id: 72c5ac1c-68c0-4206-95d6-18a193bfa77e
OutputDir: C:\Users\Administrator\.obsutil_output
TempFileDir: C:\Users\Administrator\temp

[---------------------------] 100.00% tps:484.98 162.11KB/s 4/4 498B/498B 205ms
Succeed count:      4         Failed count:       0
Succeed bytes:      498B
Metrics [max cost:86 ms, min cost:85 ms, average cost:43.25 ms, average tps:9.13, transferred size:498B]

Task id: 72c5ac1c-68c0-4206-95d6-18a193bfa77e

Run the dir /b /s command to view all files, folders, and files in subdirectories in the test directory. It is found that there are only the TEST\ folder and the TEST\foo.txt file kept.

In this case, the local files downloaded may not be completely the same as the original OBS objects. The local file TEST\foo.txt is actually TEST/FOO.txt (but not test/foo.txt) in OBS. This is determined by the download success sequence of files. How files and folders are kept on a local Windows PC is based on the following rules:

  1. Folders: The folder that is first successfully downloaded is kept. For example, if TEST/ is downloaded successfully before test/, only the TEST/ folder will be kept on your local Windows PC.
  2. Files: The name of the file that is first downloaded successfully and the content of the file that is last downloaded successfully will be kept. For example, if test/foo.txt is downloaded before TEST/FOO.txt, the file name will be foo.txt, but the file content will be that of FOO.txt.