/** => zzip_dir_stat * This function will obtain information about a opened file which may be * either real/zipped. The file is supposed to be open (otherwise -1 is * returned). The st_size stat-member contains the uncompressed size. * The optional d_name is never set here. For a real file, we do set the * d_csize := st_size and d_compr := 0 for meaningful defaults. */ int zzip_fstat (ZZIP_FILE* file, ZZIP_STAT* zs) { if (ZZIP_file_real(file)) { struct stat st; if (fstat (file->fd, &st) < 0) return -1; zs->st_size = st.st_size; zs->d_csize = st.st_size; zs->d_compr = 0; return 0; }else{ return zzip_file_stat (file, zs); } }
/** => zzip_dir_stat * This function will obtain information about a opened file which may be * either real/zipped. The file is supposed to be open (otherwise -1 is * returned). The st_size stat-member contains the uncompressed size. * The optional d_name is never set here. For a real file, we do set the * d_csize := st_size and d_compr := 0 for meaningful defaults. */ int zzip_fstat (ZZIP_FILE* file, ZZIP_STAT* zs) { if (ZZIP_file_real(file)) { // JMW TODO! #if (WINDOWSPC>0) struct stat st; if (fstat (file->fd, &st) < 0) return -1; zs->st_size = st.st_size; zs->d_csize = st.st_size; zs->d_compr = 0; return 0; #else return 0; #endif }else{ return zzip_file_stat (file, zs); } }