Lines Matching refs:zFile

643 ** Return true if zFile does not exist or if it is not an ordinary file.
648 static int notNormalFile(const char *zFile){
652 rc = stat(zFile, &x);
2412 ** Argument zFile is the name of a file that will be created and/or written
2414 ** zFile will be written to exists, creating it if required. The permissions
2423 const char *zFile
2425 char *zCopy = sqlite3_mprintf("%s", zFile);
2464 const char *zFile, /* File to write */
2472 if( symlink(zTo, zFile)<0 ) return 1;
2477 if( mkdir(zFile, mode) ){
2484 || 0!=fileStat(zFile, &sStat)
2486 || ((sStat.st_mode&0777)!=(mode&0777) && 0!=chmod(zFile, mode&0777))
2495 FILE *out = fopen(zFile, "wb");
2506 if( rc==0 && mode && chmod(zFile, mode & 0777) ){
2531 zUnicodeName = sqlite3_win32_utf8_to_unicode(zFile);
2554 if( utimensat(AT_FDCWD, zFile, times, AT_SYMLINK_NOFOLLOW) ){
2563 if( utimes(zFile, times) ){
2581 const char *zFile;
2593 zFile = (const char*)sqlite3_value_text(argv[0]);
2594 if( zFile==0 ) return;
2602 res = writeFile(context, zFile, argv[1], mode, mtime);
2604 if( makeDirectory(zFile)==SQLITE_OK ){
2605 res = writeFile(context, zFile, argv[1], mode, mtime);
2611 ctxErrorMsg(context, "failed to create symlink: %s", zFile);
2613 ctxErrorMsg(context, "failed to create directory: %s", zFile);
2615 ctxErrorMsg(context, "failed to write file: %s", zFile);
6086 char *zFile; /* Filename (sqlite3_malloc()) */
6152 char *zFile; /* Zip file this table accesses (may be NULL) */
6217 const char *zFile = 0;
6237 zFile = argv[3];
6238 nFile = (int)strlen(zFile)+1;
6248 if( zFile ){
6249 pNew->zFile = (char*)&pNew->aBuffer[ZIPFILE_BUFFER_SIZE];
6250 memcpy(pNew->zFile, zFile, nFile);
6251 zipfileDequote(pNew->zFile);
6264 sqlite3_free(p->cds.zFile);
6725 pNew->cds.zFile = sqlite3_mprintf("%.*s", nFile, aRead);
6728 if( pNew->cds.zFile==0 ){
6917 sqlite3_result_text(ctx, pCDS->zFile, -1, SQLITE_TRANSIENT);
6972 if( !(mode & S_IFDIR) && pCDS->zFile[pCDS->nFile-1]!='/' ){
7127 const char *zFile = 0; /* Zip file to scan */
7133 if( pTab->zFile ){
7134 zFile = pTab->zFile;
7148 zFile = (const char*)sqlite3_value_text(argv[0]);
7152 pCsr->pFile = fopen(zFile, "rb");
7154 zipfileCursorErr(pCsr, "cannot open file: %s", zFile);
7212 pNew->cds.zFile = sqlite3_mprintf("%s", zPath);
7213 if( pNew->cds.zFile==0 ){
7242 memcpy(a, pCds->zFile, (int)pCds->nFile);
7332 if( pTab->zFile==0 || pTab->zFile[0]==0 ){
7341 pTab->pWriteFd = fopen(pTab->zFile, "ab+");
7344 "zipfile: failed to open file %s for writing", pTab->zFile
7451 if( zipfileComparePath(pOld->cds.zFile, zDelete, nDelete)==0 ){
7537 if( zipfileComparePath(p->cds.zFile, zPath, nPath)==0 ){
7651 memcpy(a, pCDS->zFile, pCDS->nFile);
7951 e.cds.zFile = zName;
15018 static FILE *output_file_open(const char *zFile, int bTextMode){
15020 if( strcmp(zFile,"stdout")==0 ){
15022 }else if( strcmp(zFile, "stderr")==0 ){
15024 }else if( strcmp(zFile, "off")==0 ){
15027 f = fopen(zFile, bTextMode ? "w" : "wb");
15029 utf8_printf(stderr, "Error: cannot open \"%s\"\n", zFile);
15108 const char *zFile; /* Name of the input file */
15191 p->zFile, p->nLine, cQuote);
15195 p->zFile, startLine, cQuote);
16184 const char *zFile; /* --file argument, or NULL */
16262 pAr->zFile = zArg;
16695 if( pAr->zFile ){
16702 zTab, pAr->zFile
16741 if( pAr->bZip && pAr->zFile ){
16769 if( cmd.zFile ){
16770 eDbType = deduceDatabaseType(cmd.zFile, 1);
16776 if( cmd.zFile==0 ){
16779 cmd.zSrcTable = sqlite3_mprintf("zipfile(%Q)", cmd.zFile);
16783 }else if( cmd.zFile ){
16794 utf8_printf(pState->out, "-- open database '%s'%s\n", cmd.zFile,
16797 rc = sqlite3_open_v2(cmd.zFile, &cmd.db, flags,
16801 cmd.zFile, sqlite3_errmsg(cmd.db)
17783 const char *zFile = (const char*)sqlite3_column_text(pStmt,2);
17787 azName[nName*2+1] = strdup(zFile);
18251 char *zFile = 0; /* Name of file to extra content from */
18275 if( zFile==0 ){
18276 zFile = z;
18308 zFile==0 ? "FILE" : "TABLE");
18356 sCtx.zFile = zFile;
18358 if( sCtx.zFile[0]=='|' ){
18364 sCtx.in = popen(sCtx.zFile+1, "r");
18365 sCtx.zFile = "<pipe>";
18369 sCtx.in = fopen(sCtx.zFile, "rb");
18373 utf8_printf(stderr, "Error: cannot open \"%s\"\n", zFile);
18410 utf8_printf(stderr,"%s: empty file\n", sCtx.zFile);
18487 sCtx.zFile, startLine, nCol, i+1);
18499 sCtx.zFile, startLine, nCol, i);
18505 utf8_printf(stderr, "%s:%d: INSERT failed: %s\n", sCtx.zFile,
18714 const char *zFile, *zProc;
18721 zFile = azArg[1];
18724 rc = sqlite3_load_extension(p->db, zFile, zProc, &zErrMsg);
18738 const char *zFile = azArg[1];
18740 p->pLog = output_file_open(zFile, 0);
18914 char *zFile = 0;
18944 }else if( zFile==0 && eMode!='e' && eMode!='x' ){
18945 zFile = sqlite3_mprintf("%s", z);
18946 if( zFile[0]=='|' ){
18947 while( i+1<nArg ) zFile = sqlite3_mprintf("%z %s", zFile, azArg[++i]);
18955 sqlite3_free(zFile);
18959 if( zFile==0 ) zFile = sqlite3_mprintf("stdout");
18982 sqlite3_free(zFile);
18983 zFile = sqlite3_mprintf("%s", p->zTempFile);
18986 if( zFile[0]=='|' ){
18992 p->out = popen(zFile + 1, "w");
18994 utf8_printf(stderr,"Error: cannot open pipe \"%s\"\n", zFile + 1);
18999 sqlite3_snprintf(sizeof(p->outfile), p->outfile, "%s", zFile);
19003 p->out = output_file_open(zFile, bTxtMode);
19005 if( strcmp(zFile,"off")!=0 ){
19006 utf8_printf(stderr,"Error: cannot write to \"%s\"\n", zFile);
19012 sqlite3_snprintf(sizeof(p->outfile), p->outfile, "%s", zFile);
19015 sqlite3_free(zFile);