Closed chreniuc closed 2 months ago
We had the same problem. It turns out the SDK has no idea about the file, because it only cares about the stream and the stream must be opened before the transfer. The file gets created by the FStream constructor.
Furthermore, if you wish to actually have an error message, you need to make it possible to rewind the stream. We ended up with std::ios_base::in | std::ios_base::out | std::ios_base::trunc | std::ios_base::binary
flags for the stream, and we delete the file ourselves.
Can you give us a minimal reproduction sample? I'm not able to reproduce the error that you're seeing with the code snippet that you pasted above.
Greetings! It looks like this issue hasn’t been active in longer than a week. We encourage you to check if this is still an issue in the latest release. Because it has been longer than a week since the last update on this, and in the absence of more information, we will be closing this issue soon. If you find that this is still a problem, please feel free to provide a comment or add an upvote to prevent automatic closure, or if the issue is already closed, please feel free to open a new one.
Describe the bug
Hi,
we are trying to download a file from S3 using
GetObjectAsync
withAws::FStream
as aResponseStreamFactory
so it downloads it directly in a file locally.The thing is that when that file doesn't exists on S3, it generates a local file with some xml content that says that the file cannot be found and it also logs this:
Expected Behavior
The local file shouldn't be created locally and populated when it doesn't exist on S3.
Current Behavior
The file is created and populated with the following xml:
Reproduction Steps
Code used to download the file and the handler:
And our handler is this:
Possible Solution
Do not create the file locally if 404 is received.
Additional Information/Context
No response
AWS CPP SDK version used
1.8.1
Compiler and Version used
gcc 7.4
Operating System and version
Ubuntu 20.04