doc-exports/docs/modelarts/umn/modelarts_13_0038.html
Lai, Weijian 4e4b2d5f6d ModelArts UMN 23.3.0 Version.
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
Co-authored-by: Lai, Weijian <laiweijian4@huawei.com>
Co-committed-by: Lai, Weijian <laiweijian4@huawei.com>
2024-06-26 07:03:02 +00:00

1.9 KiB

Failed to Access a Folder Using MoXing and Read the Folder Size Using get_size

Symptom

  • The folder cannot be accessed using MoXing.
  • The folder size read by using get_size of MoXing is 0.

Possible Cause

To use MoXing to access a folder, you need to add the recursive=True parameter. The default value is False.

Solution

Obtain the size of an OBS folder.

mox.file.get_size('obs://bucket_name/sub_dir_0/sub_dir_1', recursive=True)

Obtain the size of an OBS file.

mox.file.get_size('obs://bucket_name/obs_file.txt')