123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
|
**
** Compress a file using gzip.
*/
void test_gzip_cmd(void){
Blob b;
char *zOut;
if( g.argc!=3 ) usage("FILENAME");
sqlite4_open(0, ":memory:", &g.db, SQLITE_OPEN_READWRITE);
gzip_begin(0);
blob_read_from_file(&b, g.argv[2]);
zOut = mprintf("%s.gz", g.argv[2]);
gzip_step(blob_buffer(&b), blob_size(&b));
blob_reset(&b);
gzip_finish(&b);
blob_write_to_file(&b, zOut);
|
|
|
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
|
**
** Compress a file using gzip.
*/
void test_gzip_cmd(void){
Blob b;
char *zOut;
if( g.argc!=3 ) usage("FILENAME");
sqlite4_open(0, ":memory:", &g.db, SQLITE4_OPEN_READWRITE);
gzip_begin(0);
blob_read_from_file(&b, g.argv[2]);
zOut = mprintf("%s.gz", g.argv[2]);
gzip_step(blob_buffer(&b), blob_size(&b));
blob_reset(&b);
gzip_finish(&b);
blob_write_to_file(&b, zOut);
|