Skip to content

Add Unix pipe support for put and get#246

Merged
AndreyVMarkelov merged 1 commit into
masterfrom
pipe-support
Jun 19, 2026
Merged

Add Unix pipe support for put and get#246
AndreyVMarkelov merged 1 commit into
masterfrom
pipe-support

Conversation

@AndreyVMarkelov

@AndreyVMarkelov AndreyVMarkelov commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Summary

  • put - <target>: upload from stdin (spooled to temp file, then existing upload path)
  • get <source> -: download to stdout (byte-clean, retry before first byte only)
  • EPIPE/broken pipe handled gracefully (exit 0, no noisy stack trace)
  • Temp file security: 0600 permissions, name independent of target/content
  • Cleanup failure after successful upload reports error with temp path on stderr

Closes #194

Test plan

  • put - without target errors
  • put - /file.txt uploads stdin content
  • put - /- uploads to Dropbox path /-
  • put ./- /remote uploads local file named -
  • put - /folder/ rejects directory-style target
  • put - --recursive rejects
  • put - /existing-folder rejects when metadata says folder
  • Empty stdin creates zero-byte file
  • Cleanup failure after upload returns non-zero with sensitive-data warning
  • get /file.txt - writes exact bytes to stdout
  • get /- - downloads Dropbox path /-
  • get /folder - and get -r /folder - reject
  • Stdout download creates no local files
  • Retry before first byte, no retry after partial output
  • Writer EPIPE returns nil (clean exit)
  • SIGPIPE ignored during stdout download (Unix)
  • Existing put, put -r, get, get -r behavior unchanged

Support stdin upload (`put - <target>`) and stdout download
(`get <source> -`). Stdin is spooled to a temp file before upload;
stdout downloads are byte-clean with retry-before-first-byte semantics
and graceful EPIPE handling.

Closes #194
@AndreyVMarkelov AndreyVMarkelov merged commit 3b76c04 into master Jun 19, 2026
7 checks passed
@AndreyVMarkelov AndreyVMarkelov mentioned this pull request Jun 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature requrest: Upload from standard input

1 participant