/* ** COMMAND: test-tarball ** ** Generate a GZIP-compressed tarball in the file given by the first argument ** that contains files given in the second and subsequent arguments. */ void test_tarball_cmd(void){ int i; Blob zip; Blob file; if( g.argc<3 ){ usage("ARCHIVE FILE...."); } sqlite3_open(":memory:", &g.db); tar_begin(0); for(i=3; i<g.argc; i++){ blob_zero(&file); blob_read_from_file(&file, g.argv[i]); tar_add_file(g.argv[i], &file, file_wd_perm(g.argv[i]), file_wd_mtime(g.argv[i])); blob_reset(&file); } tar_finish(&zip); blob_write_to_file(&zip, g.argv[2]); }
/* ** Return TRUE if the named file is a symlink and symlinks are allowed. ** Return false for all other cases. ** ** On Windows, always return False. */ int file_wd_islink(const char *zFilename){ return file_wd_perm(zFilename)==PERM_LNK; }
/* ** Return TRUE if the named file is an executable. Return false ** for directories, devices, fifos, symlinks, etc. */ int file_wd_isexe(const char *zFilename){ return file_wd_perm(zFilename)==PERM_EXE; }