site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com Dkim-signature: v=1; a=rsa-sha1; c=relaxed; d=alastairs-place.net; h= subject:mime-version:content-type:from:in-reply-to:date:cc: content-transfer-encoding:message-id:references:to; q=dns/txt; s= aug07; bh=Tt550S30oQzjXId4OoRpgNUIWkY=; b=iriya/Ssb7RyQcYifHfJWb fvCEs2UZMweErU3QOGroZjzSCZUg5IBfbbWdReHwRaPEroTvn0CfkPqYIKaPpEIA UgoiQH0c6A9xIHL7EgLn134Sj7ycM60wUkuW85QOVdKXsIyzvmm/uL+H3oPwP/n9 hymWYwz//EjAcCoFTOig8= On 3 Nov 2009, at 15:57, 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) The size-related fields of the structures are as follows: st_blksize The optimal I/O block size for the file. Kind regards, Alastair. -- http://alastairs-place.net _______________________________________________ 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... st_blksize isn't what you think. Check the stat(2) man page, where you'll see it says: st_blocks The actual number of blocks allocated for the file in 512-byte units. As short symbolic links are stored in the inode, this number may be zero. This email sent to site_archiver@lists.apple.com