Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 13 Jun 2012 14:55:12 -0700
From:      Chuck Swiger <cswiger@mac.com>
To:        Peter Vereshagin <peter@vereshagin.org>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: `ls -l` shows size of file other than of the folder?
Message-ID:  <1D62BA9B-7B6A-4313-B73F-0C7C695B7211@mac.com>
In-Reply-To: <20120613202325.GC5800@external.screwed.box>
References:  <20120613202325.GC5800@external.screwed.box>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi--

On Jun 13, 2012, at 1:23 PM, Peter Vereshagin wrote:
> I have the directory in the file system with 2 regular files each  of  which  is
> sized as 700M according to 'ls -l'.  But the torrent client and 'du -s' and  'ls
> -l's 'total' show that the directory size is 300M.
> 
> How can that be?  Are there different file sizes  stored  on  a  ufs1  in  their
> metadata?

It's very likely that these are sparse files.  Your torrent client creates a file
of the appropriate size via fseek()/lseek() or similar, but the space isn't actually
consumed until it writes the data it is obtaining from the network....

Random link: http://www.unixguide.net/unix/sparse_file.shtml

Regards,
-- 
-Chuck




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1D62BA9B-7B6A-4313-B73F-0C7C695B7211>