cf cli should separate stderr and stdout content
When transferring files using cf files or cf curl from the DEA App instance container, the cli adds newline to the content. This can cause file corruption when transferring binary file content (read can fail as there is additional content past the actual EOF). It would be good to separate the stderr and stdout so the newline goes to the stderr, while the stdout can contain the pure output.
Example: Try to transfer a binary file using cf curl and save it and then try to check the file size. Invariably, the downloaded file size would be 1 byte extra compared to actual file on the DEA container due to the newline getting adding to the final output. If the stdout and stderr are separate, users can save the stdout as pure file content instead of stripping the additional newline that can go to the stderr.
We have created an issue in Pivotal Tracker to manage this. You can view the current status of your issue at: https://www.pivotaltracker.com/story/show/72659362.
We'll enable curl downloads direct to file since cleaning up stderr/stdout output would take a lot more effort. This should be in the edge build now.
Usage in the edge build would look something like this
cf curl path/to/some/binary/data -o some/file/path
Thanks, David.
The --output option worked great, got the exact set of bytes.
- Sabha
Sent from my iPhone
On Jun 10, 2014, at 8:58 AM, David Lee [email protected] wrote:
We'll enable curl downloads direct to file since cleaning up stderr/stdout output would take a lot more effort. This should be in the edge build now.
— Reply to this email directly or view it on GitHub.