MCPcopy Create free account
hub / github.com/GaijinEntertainment/daScript / output_file_open

Function output_file_open

modules/dasSQLITE/sqlite/shell.c:20759–20774  ·  view source on GitHub ↗

** 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". */

Source from the content-addressed store, hash-verified

20757** filename is "off".
20758*/
20759static 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/*

Callers 1

do_meta_commandFunction · 0.85

Calls 2

cli_strcmpFunction · 0.85
utf8_printfFunction · 0.85

Tested by

no test coverage detected