Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gbak should document "stdin" and "stdout" magic words a bit better [DOC83] #93

Closed
firebird-automations opened this issue Jan 10, 2013 · 5 comments

Comments

@firebird-automations
Copy link

Submitted by: Steve Friedl (sjfriedl)

The gbak command supports I/O to and from standard input and standard output via the magic literal words "stdin" and "stdout" on the command line, and as this is an uncommon mechanism in the UNIX world. some clarity would help those who mistakenly interchange them with the more common mechanisms, /dev/stdin and /dev/stdout. Though performing redirection with the /dev-based names to a file works fine, it does NOT work properly for a pipe.

This scenario on a Linux system with 2.0.6 (credentials omitted for clarity)

gbak \-backup file\.gdb /dev/stdout \| gbak \-replace /dev/stdin file\.gdb\.new

fails with "gbak: ERROR:expected backup description record" error from the restore process as it tries to seek on the input. Pipes don't allow seek, and it's just obvious that we should be doing it as

gbak \-backup file\.gdb stdout \| gbak \-replace stdin file\.gdb\.new

instead; I had to dig into the code to discover that it's literal strings that route the code through a different path that appear to avoid seeks.

I believe the documentation ought to be a bit more clear on this, with an explicit caveat "/dev/stdin is not the same as the word stdin"; this would have saved us a lot of time. My impression would be that adding a note to the page http://www.firebirdsql.org/manual/gbak-caveats.html would be a great place for this.

@firebird-automations
Copy link
Author

Commented by: @paulvink

Seems you've already fixed it ;-)

@firebird-automations
Copy link
Author

Modified by: @paulvink

assignee: Paul Vinkenoog [ paulvink ] => Norman Dunbar [ normandunbar ]

@firebird-automations
Copy link
Author

Modified by: @NormanDunbar

timespent: 3600 [ 3600 ]

timeestimate: 0 [ 0 ]

@firebird-automations
Copy link
Author

Commented by: @NormanDunbar

Fixed in release 1.7 of the Gbak Manual. This will be uploaded when I have checked that all is well with formatting, spelling etc.

@firebird-automations
Copy link
Author

Modified by: @NormanDunbar

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants