查看文件是否存在
更新时间:2022-10-14
用户可通过如下操作查看某文件是否存在:
begin
client.get_object_meta_data(bucket_name, object_name)
rescue BceServerException => e
puts "#{object_name} not exist!" if e.status_code == 404
end
用户可通过如下操作查看某文件是否存在:
begin
client.get_object_meta_data(bucket_name, object_name)
rescue BceServerException => e
puts "#{object_name} not exist!" if e.status_code == 404
end