Cannot find files or folders matching .... AWS S3
조회 수: 8 (최근 30일)
이전 댓글 표시
Hey experts!
I am totally new to working with remote data. Hopefully my problem is easy for you, since I am a beginner. But unfortunately I really can´t find the mistake by myselft right now.
The task is to open .json files which are stored in a AWS S3 bucket. I tested my key ID and secret key for the s3://test-export/ bucket in the windows console using the AWS CLI:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/909710/image.png)
For me this looks like my "login" is working and I successfully get the sample json file in the bucket. Trying to do the same in MATLAB is not yet working:
AWS.data.bucketname = 'test-export';
AWS.data.path2file = fullfile('s3://', AWS.data.bucketname, '/');
AWS.login.accessKeyID = 'AAAAAAAAAAAAAAAAAAAAA';
AWS.login.secretAccessKey = 'BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB';
setenv('AWS_ACCESS_KEY_ID', AWS.login.accessKeyID);
setenv('AWS_SECRET_ACCESS_KEY', AWS.login.secretAccessKey);
setenv('AWS_DEFAULT_REGION ', 'eu-central-1');
fds = fileDatastore(AWS.data.path2file,'ReadFcn',@load);
... leads to the error:
Error using fileDatastore (line 226)
Cannot find files or folders matching: 's3:\\test-export\'.
Any ideas why I can make it work in the windows console but can´t find the path when usind fileDatastore in Matlab? How is my path definition wrong?
Thank you very much and best regards!
댓글 수: 0
답변 (1개)
Prince Kumar
2022년 4월 6일
Hi,
It looks like you are not reading the data properly.
Please fo through the following doumentation and look couple of examples for better understanding:
Hope this helps!
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Startup and Shutdown에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!