FreeBSD/lib/libstand/dosfs.c
/*
 * Return size of file in bytes
 */
Return size of file in bytes
Return size of file in bytes
static off_t
fsize(DOS_FS *fs, DOS_DE *de)
{
   u_long size;
   u_int c;
   int n;
   if (!(size = cv4(de->size)) && de->attr & FA_DIR) {
      if (!(c = cv2(de->clus)))
         size = fs->dirents * sizeof(DOS_DE);
      else {
         if ((n = fatcnt(fs, c)) == -1)
            return n;
         size = blkbyt(fs, n);
      }
   }
   return size;
}
static off_t fsize ( DOS_FS * fs , DOS_DE * de ) { u_long size ; u_int c ; int n ; if ( ! ( size = cv4 ( de -> size ) ) && de -> attr & FA_DIR ) { if ( ! ( c = cv2 ( de -> clus ) ) ) size = fs -> dirents * sizeof ( DOS_DE ) ; else { if ( ( n = fatcnt ( fs , c ) ) == -1 ) return n ; size = blkbyt ( fs , n ) ; } } return size ; }
Return size of file in bytes
Return size of file in bytes