** Try to open an output file. The names "stdout" and "stderr" are ** recognized and do the right thing. NULL is returned if the output ** filename is "off". */
| 20757 | ** filename is "off". |
| 20758 | */ |
| 20759 | static FILE *output_file_open(const char *zFile, int bTextMode){ |
| 20760 | FILE *f; |
| 20761 | if( cli_strcmp(zFile,"stdout")==0 ){ |
| 20762 | f = stdout; |
| 20763 | }else if( cli_strcmp(zFile, "stderr")==0 ){ |
| 20764 | f = stderr; |
| 20765 | }else if( cli_strcmp(zFile, "off")==0 ){ |
| 20766 | f = 0; |
| 20767 | }else{ |
| 20768 | f = fopen(zFile, bTextMode ? "w" : "wb"); |
| 20769 | if( f==0 ){ |
| 20770 | utf8_printf(stderr, "Error: cannot open \"%s\"\n", zFile); |
| 20771 | } |
| 20772 | } |
| 20773 | return f; |
| 20774 | } |
| 20775 | |
| 20776 | #ifndef SQLITE_OMIT_TRACE |
| 20777 | /* |
no test coverage detected