티스토리 뷰
C, C++
Ncloud object storage (amazon s3 c++ sdk) 1000개 이상 오브젝트 불러오기(amazon s3 c++ sdk object list get more than 1000)
j0n9m1n1 2019. 11. 26. 10:57반응형
bool ListObject() {
int cnt = 0;
Aws::String endp = "kr.object.ncloudstorage.com";
Aws::Client::ClientConfiguration config;
config.endpointOverride = endp;
config.region = "kr-standard";
config.scheme = Aws::Http::Scheme::HTTP;
Aws::S3::S3Client s3_client(Aws::Auth::AWSCredentials(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY),
config);
Aws::S3::Model::ListObjectsRequest request;
request.WithBucket(bucket_name);
bool isDone = false;
while (!isDone)
{
auto list_objects_outcome = s3_client.ListObjects(request);
Aws::Vector<Aws::S3::Model::Object> object_list =
list_objects_outcome.GetResult().GetContents();
for (auto const &s3_object : object_list)
{
std::cout << cnt << s3_object.GetKey() << std::endl;
cnt++;
}
isDone = !list_objects_outcome.GetResult().GetIsTruncated();
if (!isDone)
request.SetMarker(list_objects_outcome.GetResult().GetNextMarker());
}
return true;
}
'C, C++' 카테고리의 다른 글
CreateProcess cmd로 실행 부등호 인식(greater than, lower than) (0) | 2021.05.11 |
---|---|
비주얼 스튜디오 탭 드래그 크래시 (0) | 2021.03.17 |
C++ ncloud AWS SDK Nuget 이용하기 Windows10 visual studio 17(bucket create, delete / file upload, delete) (0) | 2019.11.19 |
DCMTK 3.6.4 dll, lib CMake VS2019 (0) | 2019.08.05 |
FFmpeg with QT 동영상 인코더 (0) | 2018.06.20 |
댓글
티스토리 방명록
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
Blog is powered by
Tistory / Designed by
Tistory
Contact: j0n9m1n1@gmail.com
Contact: j0n9m1n1@gmail.com