查看文件是否存在
更新时间:2022-07-13
用户可通过如下操作查看某文件是否存在:
from baidubce import exception
try:
response = bos_client.get_object_meta_data(bucket_name, object_key)
print("Get meta:{}",response.metadata)
except exception.BceError as e:
print(e)
用户可通过如下操作查看某文件是否存在:
from baidubce import exception
try:
response = bos_client.get_object_meta_data(bucket_name, object_key)
print("Get meta:{}",response.metadata)
except exception.BceError as e:
print(e)