site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=zyrKbwEBzX1a6aPWkJckjallmxEcTidF6Xr2pkh6sTQ=; b=ApisnBjTv9WnXJ4jXHKXWWkkh+ufdcDW9g87+HXUGmyruXfOvauKDRGtTJugGtVqwU BmTuv2VpogcUm2G1zonOIdDdjpD7l3bM4l1b7Mh6AWlj03Rr47aeZJuYlg2sl30sAS1Y jS6gurtJII8nfNxSMnsxd8H15nmHB5GAlns6o= Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=d0HCtUnHoiYbOuYEZOuuQIItwV86mYUdHSMguUVaoIc1NSuAaQvqtoZsi/UuUQchfg tiaXUIA8LP78uLxIx2sGfmD50LF2hQ2jPVJM1PVpCaiqlmt8ity0QIeqHM9VE9ujpvir vC9py0JbaCjh/5JPM/zBh0+ZNFZL0+cni4RMw= Thanks a lot :) I will try this Would st_blksize vary for every file ? Also is there any macro I can use instead of directly using 512 ? On Tue, Nov 3, 2009 at 9:42 PM, Mike Mackovitch <macko@apple.com> wrote:
On Tue, Nov 03, 2009 at 09:27:38PM +0530, rohan a wrote:
Why the hard coded value 512 ?
To find the real size of the file I tried this : RealSize = st_blocks * st_blksize;
st_blksize returned was 4096
And the real size far execeeded the stat size (should be the opposite for sparse files)
Perhaps reading the documentation would help? From the stat(2) man page:
The size-related fields of the structures are as follows:
st_blksize The optimal I/O block size for the file.
st_blocks The actual number of blocks allocated for the file in 512-byte units. [...]
HTH --macko
_______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... This email sent to site_archiver@lists.apple.com