fix: support backup create when streaming to stdout#691
Merged
miparnisari merged 3 commits intoauthzed:mainfrom May 5, 2026
Merged
fix: support backup create when streaming to stdout#691miparnisari merged 3 commits intoauthzed:mainfrom
miparnisari merged 3 commits intoauthzed:mainfrom
Conversation
OcfFileEncoder previously failed when the destination was "-" (stdout): - Append wrote a cursor lockfile derived from fe.file.Name(), which resolved to /dev/stdout.lock and failed with "operation not permitted". - Close called file.Sync() and file.Close() on os.Stdout, surfacing "inappropriate ioctl for device". Track an isStream flag on the encoder; skip lockfile/sync/close when set and surface a clear error from Cursor() since resume is not supported on streams.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #691 +/- ##
==========================================
+ Coverage 43.60% 43.72% +0.12%
==========================================
Files 38 38
Lines 6178 6193 +15
==========================================
+ Hits 2694 2708 +14
+ Misses 3204 3203 -1
- Partials 280 282 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
miparnisari
reviewed
May 5, 2026
Contributor
There was a problem hiding this comment.
Do you mind updating the help text of zed backup create? Currently it says
$ ./zed backup create --help
Backup a permission system to a file
Usage:
zed backup create <filename> [flags]
let's make it "Backup a permission system to a file or to stdout (denoted by a dash)"
and zed backup create <filename-or-dash>
Contributor
Author
|
Updated in ecc773a. |
miparnisari
approved these changes
May 5, 2026
d51308e to
04aaf32
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
zed backup create -(write backup to stdout) currently fails with:OcfFileEncoderwas attempting to write a cursor lockfile derived fromfe.file.Name()(resolving to/dev/stdout.lock) and callingfile.Sync()/file.Close()onos.Stdoutduring shutdown.This was reported in the review of #688: #688 (review).
Closes #284.