croc icon indicating copy to clipboard operation
croc copied to clipboard

Handle stdin gracefully

Open tdussa opened this issue 3 years ago • 4 comments

The current version of croc handles stdin by buffering its input into a temporary file. While this is fine, in principle, it would be preferable for a number of reasons to avoid having temporary files:

  • There might well not be enough space for a temp file.
  • It might be desirable to start the transfer even before all input has come in from stdin -- this is currently not done because the complete temp file is written first and then transfered.

I realize this requires additional features in the croc protocol; specifically, the transfer of files of unknown size must be implemented. Also, re-starting a transfer gracefully (i. e., skipping over those blocks already transfered) is obviously impossible.

However, I think it would be a very good feature to have indeed.

tdussa avatar Apr 16 '21 06:04 tdussa

would accept a PR for this

schollz avatar Sep 20 '23 12:09 schollz

Honestly after stumbling on this issue, i would rather have croc not handle stdin at all. I think it is reasonable to expect such tool to be streaming data, not writing it to temp file. 😒

Cubixmeister avatar Dec 07 '23 13:12 Cubixmeister

was wondering the same thing as the OP ... anyways, great tool, still useful even with temp file ;)

flypenguin avatar Mar 04 '24 15:03 flypenguin

Stale issue message

github-actions[bot] avatar May 04 '24 12:05 github-actions[bot]