Lines Matching defs:file
2 ** This file is automatically generated by the script in the canonical
5 ** "shell.c" file used to implement the SQLite command-line shell.
7 ** Most of the code found below comes from the "src/shell.c.in" file in
8 ** the canonical SQLite source tree. That main file contains "INCLUDE"
10 ** inserted to getnerate this complete program source file.
13 ** source file to help make the command-line program easier to compile.
30 ** This file contains code to implement the "sqlite" command line
44 ** file. Note that this macro has a like effect on sqlite3.c compilation.
98 ** Enable large-file support for fopen() and friends on unix.
256 static void setBinaryMode(FILE *file, int isOutput){
257 if( isOutput ) fflush(file);
258 _setmode(_fileno(file), _O_BINARY);
260 static void setTextMode(FILE *file, int isOutput){
261 if( isOutput ) fflush(file);
262 _setmode(_fileno(file), _O_TEXT);
455 ** is true. Otherwise, assume stdin is connected to a file or pipe.
643 ** and is an ordinary file or a character stream source.
678 ** to the text. NULL is returned at end of file, or if malloc()
1070 ** This file contains declarations for most of the opendir() family of
1173 unsigned d_attributes; /* Win32 file attributes. */
1232 ** This file contains code to implement most of the opendir() family of
1429 ** This file implements an extension that uses the SQLITE_CONFIG_MALLOC
1435 ** This file needs to be compiled into the application that uses it.
3296 ** This file demonstrates how to create a table-valued-function using
3758 ** The code in this file implements a compact but reasonably
3762 ** This file is an SQLite extension. It registers a single function
3811 ** this file to prevent name collisions with C-library functions of the
4648 ** function writes blob DATA to file FILE. If successful, the number
4653 ** value (file type + permissions, as returned in the stat.st_mode
4663 ** regular file, it is interpreted as a blob and written into the
4664 ** named file. Regardless of the type of file, its permissions are
4669 ** modification-time of the target file is set to this value before
4677 ** Read and return the contents of file FILE (type blob) from disk.
4685 ** Parameter $path is an absolute or relative pathname. If the file that it
4687 ** file or symbolic link, it returns a single row. Or, if the path refers
4689 ** file within the hierarchy rooted at $path.
4693 ** name: Path to file or directory (text value).
4696 ** data: For a regular file, a blob containing the file data. For a
4748 #define FSDIR_COLUMN_NAME 0 /* Name of the file */
4758 ** contents of file zName. Or, leave the result unchanged (NULL)
4759 ** if the file does not exist or is unreadable.
4761 ** If the file exceeds the SQLite blob size limit, through an
4764 ** Throw an SQLITE_IOERR if there are difficulties pulling the file
4806 ** of the file named X is read and returned as a BLOB. NULL is returned
4807 ** if the file does not exist or is unreadable.
4943 ** Argument zFile is the name of a file that will be created and/or written
4991 ** header comments at the top of this file for details.
5106 ** Refer to header comments at the top of this file for details.
5147 ctxErrorMsg(context, "failed to write file: %s", zFile);
5359 fsdirSetErrmsg(pCur, "cannot stat file: %s", pCur->zPath);
5502 fsdirSetErrmsg(pCur, "cannot stat file: %s", pCur->zPath);
5675 ** This file implements an eponymous virtual table that returns suggested
6179 ** This file implements a VFS shim that allows an SQLite database to be
6180 ** appended onto the end of some other file, such as an executable.
6182 ** A special record must appear at the end of the file that identifies the
6183 ** file as an appended database and provides the offset to the first page
6189 ** the file as an ordinary SQLite database, or it might treat it as a
6190 ** database appended onto some other file. The decision is made by
6193 ** (1) An empty file is an ordinary database.
6195 ** (2) If the file ends with the appendvfs trailer string
6196 ** "Start-Of-SQLite3-NNNNNNNN" that file is an appended database.
6198 ** (3) If the file begins with the standard SQLite prefix string
6199 ** "SQLite format 3", that file is an ordinary database.
6202 ** set, then a new database is appended to the already existing file.
6207 ** the file containing the database is limited to 1GiB. (1073741824 bytes)
6210 ** database, then keep it in a separate file.
6212 ** If the file being opened is a plain database (not an appended one), then
6260 /* An open appendvfs file
6262 ** An instance of this structure describes the appended database file.
6265 ** the entire file, including the prefix, the database, and the
6271 ** | prefix-file | padding | database | append-mark |
6278 ** "prefix file" - file onto which the database has been appended.
6281 ** "database" - The SQLite database file
6283 ** the offset from the start of prefix-file to the start
6291 ** iMark will be the size of the underlying file minus 25 (APND_MARKSIZE).
6298 /* Always followed by another sqlite3_file that describes the whole file */
6391 ** Close an apnd-file.
6399 ** Read data from an apnd-file.
6413 ** Add the append-mark onto what should become the end of the file.
6441 ** Write data to an apnd-file.
6462 ** Truncate an apnd-file.
6469 /* Truncate underlying file just past append mark */
6474 ** Sync an apnd-file.
6482 ** Return the current file-size of an apnd-file.
6483 ** If the append mark is not yet there, the file-size is 0.
6492 ** Lock an apnd-file.
6500 ** Unlock an apnd-file.
6508 ** Check if another file-handle holds a RESERVED lock on an apnd-file.
6516 ** File control method. For custom operations on an apnd-file.
6531 ** Return the sector-size in bytes for an apnd-file.
6539 ** Return the device characteristic flags supported by an apnd-file.
6546 /* Create a shared memory file mapping */
6576 /* Fetch a page of a memory-mapped file */
6599 ** Try to read the append-mark off the end of a file. Return the
6629 ** Check to see if the file is an appendvfs SQLite database file.
6630 ** Return true iff it is such. Parameter sz is the file's size.
6637 /* If file has the correct end-marker, the expected odd size, and the
6654 ** Check to see if the file is an ordinary SQLite database file.
6655 ** Return true iff so. Parameter sz is the file's size.
6671 ** Open an apnd file handle.
6687 ** Just use the base VFS open to initialize the given file object and
6688 ** open the underlying file. (Appendvfs is then unused for this file.)
6708 /* The file being opened appears to be just an ordinary DB. Copy
6725 ** Note that nothing has yet been written to the underlying file.
6735 ** Delete an apnd file.
6738 ** For now, this code deletes the underlying file too.
6856 ** This file implements a virtual table for reading and writing ZIP archive
6925 ** file format for zip archives.
6939 "name PRIMARY KEY," /* 0: Name of file in zip archive */
6940 "mode," /* 1: POSIX mode for file */
6946 "z HIDDEN" /* 7: Name of zip file */
6949 #define ZIPFILE_F_COLUMN_IDX 7 /* Index of column "file" in the above */
6957 ** Use this value for the "version-made-by" field in new zip file
6959 ** indicates that the zip file matches pkzip specification 3.0.
7010 *** .ZIP file comment length 2 bytes
7011 *** .ZIP file comment (variable size)
7028 *** central file header signature 4 bytes (0x02014b50)
7033 *** last mod file time 2 bytes
7034 *** last mod file date 2 bytes
7038 *** file name length 2 bytes
7040 *** file comment length 2 bytes
7042 *** internal file attributes 2 bytes
7043 *** external file attributes 4 bytes
7068 *** 4.3.7 Local file header:
7070 *** local file header signature 4 bytes (0x04034b50)
7074 *** last mod file time 2 bytes
7075 *** last mod file date 2 bytes
7079 *** file name length 2 bytes
7102 i64 iDataOff; /* Offset to data in file (if aData==0) */
7118 FILE *pFile; /* Zip file */
7130 char *zFile; /* Zip file this table accesses (may be NULL) */
7355 ** Read nRead bytes of data from offset iOff of file pFile into buffer
7365 FILE *pFile, /* Read from this file */
7635 ** then pFile is a file-handle open on a zip file. In either case, this
7645 const u8 *aBlob, /* Pointer to in-memory file image */
7647 FILE *pFile, /* If aBlob==0, read from this file */
7937 /* Figure out if this is a directory or a zero-sized file. Consider
7971 ** is guaranteed to be a file-handle open on a zip file.
7980 const u8 *aBlob, /* Pointer to in-memory file image */
7982 FILE *pFile, /* Read from this file if aBlob==0 */
7986 int nRead; /* Bytes to read from file */
7992 i64 szFile; /* Total size of file in bytes */
8096 const char *zFile = 0; /* Zip file to scan */
8128 zipfileCursorErr(pCsr, "cannot open file: %s", zFile);
8215 /* Add the file name */
8277 ** Or vice-versa - no data but "mode" is a file or symlink. */
8311 /* Open a write fd on the file. Also load the entire central directory
8312 ** structure into memory. During the transaction any new file data is
8313 ** appended to the archive file, but the central directory is accumulated
8318 "zipfile: failed to open file %s for writing", pTab->zFile
8450 ** a regular file or a symlink. */
8708 "\"file-name-length\" : %u, "
8710 "\"file-comment-length\" : %u, "
11318 /* Create candidate indexes within the in-memory database file */
11428 ** This file contains an implementation of two eponymous virtual tables,
12373 ** This file contains the public interface to the "recover" extension -
12451 ** string parameter zUri. zUri may be an absolute or relative file path,
12452 ** or may be an SQLite URI. If the identified database file already exists,
12635 ** Declaration for public API function in file dbdata.c. This may be called
14840 ** Detect the page-size of the database opened by file-handle pFd by
14841 ** searching the first part of the file for a well-formed SQLite b-tree
14857 i64 nSz /* Size of database file in bytes */
14920 /* Ensure that the database has a valid header file. The only fields
15135 ** Install the VFS wrapper around the file-descriptor open on the input
15155 ** Uninstall the VFS wrapper that was installed around the file-descriptor open
15567 char *zTempFile; /* Temporary file that might need deleting */
15601 const char * zDefaultDbName; /* Default name for db file */
15621 #define SHELL_OPEN_NORMAL 1 /* Normal database file */
15780 ** (1) Write VALUE into a temporary file.
15781 ** (2) Run program EDITOR on that temporary file.
15782 ** (3) Read the temporary file back and return its content as the result.
15783 ** (4) Delete the temporary file
15834 /* When writing the file to be edited, do \n to \r\n conversions on systems
15838 sqlite3_result_error(context, "edit() cannot open temp file", -1);
15853 sqlite3_result_error(context, "edit() could not write the whole file", -1);
15870 "edit() cannot reopen temp file after edit", -1);
15885 sqlite3_result_error(context, "could not read back the whole file", -1);
15895 /* If the file did not originally contain \r\n then convert any new
18739 " -f FILE, --file FILE Use archive FILE (default is current db)",
18794 " --bom Put a UTF8 byte-order mark on intermediate file",
19088 ** Read the content of file zName into memory obtained from sqlite3_malloc64()
19096 ** from the file before the buffer is returned. This byte is not included in
19173 ** Try to deduce the type of file for zName based on its content. Return
19176 ** If the file does not exist or is empty but its name looks like a ZIP
19219 ** program. Read content from the file in p->aAuxDb[].zDbFilename.
19464 ** ZIP archive if the file does not exist or is empty and its name matches
19775 ** Close an output file, assuming it is not stderr or stdout
19782 ** Try to open an output file. The names "stdout" and "stderr" are
19877 const char *zFile; /* Name of the input file */
19922 ** EOF on end-of-file.
20012 ** EOF on end-of-file.
20229 ** Open a new database file named "zNewDb". Try to recover as much information
20256 ** Change the output file back to stdout.
20259 ** redirected to a temporary file named by p->zTempFile. In that case,
20260 ** launch start/open/xdg-open on that temporary file.
20286 ** p->zTempFile data file out from under it */
20331 { "file change counter:", 24 },
20541 ** Delete a file.
20556 ** Try to delete the temporary file (if there is one) and free the
20557 ** memory used to hold the name of the temp file.
20568 ** Create a new temp file name with the given suffix.
20578 /* If p->db is an in-memory database then the TEMPFILENAME file-control
20958 char *zSrcTable; /* "sqlar", "zipfile($file)" or "zip" */
20959 const char *zFile; /* --file argument, or NULL */
21041 /* Fall thru into --file */
21078 { "file", 'f', AR_SWITCH_FILE, 1 },
21201 ** file is not present in the archive, an error is printed to stderr and an
21464 ** Then add each file in the azFile[] array to the archive. Directories
21466 ** printed on stdout for each file archived.
21470 ** always overwrites every file named on the command-line, where as
21476 int bOnlyIfChanged /* Only update if file has changed */
21480 " name TEXT PRIMARY KEY, -- name of the file\n"
21483 " sz INT, -- original file size\n"
21628 utf8_printf(stderr, "cannot open file: %s (%s)\n",
21796 #ifdef SHELL_COLFIX_DB /* If this is set, the DB can be in a file. */
22199 ** Then read the content of the testcase-out.txt file and compare against
22247 zFile = "(temporary-file)";
22613 /* --help lists all file-controls */
22615 utf8_printf(p->out, "Available file-controls:\n");
22633 utf8_printf(stderr, "Error: ambiguous file-control: \"%s\"\n"
22641 utf8_printf(stderr,"Error: unknown file-control: %s\n"
22787 char *zFile = 0; /* Name of file to extra content from */
22963 utf8_printf(stderr,"%s: empty file\n", sCtx.zFile);
23026 ** Did we reach end-of-file before finding any columns?
23031 ** Did we reach end-of-file OR end-of-line before finding any
23454 char *zNewFilename = 0; /* Name of the database file to open */
23456 int newFlag = 0; /* True to delete file before opening */
24135 ** Write a changeset or patchset into a file. The file is overwritten.
24758 /* Begin redirecting output to the file "testcase-out.txt" */
25479 ** is coming from a file or device. A prompt is issued and history
25661 ** Read input from the file given by sqliterc_override. Or if that
25668 const char *sqliterc_override /* Name of config file. NULL to use default */
25710 " -append append the database to the end of the file\n"
25722 " -init FILENAME read/process named file\n"
25764 " -zip open the file as a ZIP Archive\n"
25771 "if the file does not previously exist.\n", Argv0);
25971 ** of a C-function that will provide the name of the database file. Use
25981 ** the name of the database file, the name of the initialization file,
26158 /* Go ahead and open the database file if it already exists. If the
26159 ** file does not exist, delay opening it. This prevents empty database
26167 /* Process the initialization file if there is one. If no -init option
26168 ** is given on the command line, look for a file named ~/.sqliterc and
26175 ** file is processed so that the command-line arguments will override
26176 ** settings in the initialization file.
26528 ** Uses the current database's VFS xRead to stream the db file's
26534 ** expects that it will be the only thread reading the db file and