cli icon indicating copy to clipboard operation
cli copied to clipboard

cf cli should separate stderr and stdout content

Open sparameswaran opened this issue 12 years ago • 4 comments

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.

sparameswaran avatar Jun 04 '14 22:06 sparameswaran

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.

cf-gitbot avatar Jun 04 '14 22:06 cf-gitbot

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.

lcddave avatar Jun 10 '14 15:06 lcddave

Usage in the edge build would look something like this

cf curl path/to/some/binary/data -o some/file/path

tjarratt avatar Jun 10 '14 20:06 tjarratt

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.

sparameswaran avatar Jun 10 '14 23:06 sparameswaran