Subject gbak as a service from commandline
Author Nick Upson
I'm trying to get gbak to fail & exit rather than prompt for another file if
the file being restored has been truncated.
(fb 1.5.4). I had a look at the source code (excerpt below) and it looks to
me that, if I can convince gbak it is
operating as a service, it will then read from stdin, then I can feed it a
ctrl-C or ctrl-D which are currently ignored.

I can't get it to work however.

The command-line (fedora 8) I am using is:
gbak -se localhost:service_mgr -user sysdba -pass genesis -create
/opt/unb/db/t1.fbk /opt/unb/db/t1.fdb

(from mvol.cpp)

/* Unless we are operating as a service, stdin can't necessarily be trusted.
Get a location to read from. */

if (tdgbl->gbl_sw_service_gbak ||
isatty(ib_fileno(ib_stdout)) ||
!(term_out = ib_fopen(TERM_OUTPUT, "w")))
{
term_out = ib_stdout;
}
if (tdgbl->gbl_sw_service_gbak ||
isatty(ib_fileno(ib_stdin)) ||
!(term_in = ib_fopen(TERM_INPUT, "r")))
{
term_in = ib_stdin;
}


[Non-text portions of this message have been removed]