Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: Identifying sparse files using getattrlist()
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Identifying sparse files using getattrlist()



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 <email@hidden> 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      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Identifying sparse files using getattrlist() (From: rohan a <email@hidden>)
 >Re: Identifying sparse files using getattrlist() (From: Alastair Houghton <email@hidden>)
 >Re: Identifying sparse files using getattrlist() (From: rohan a <email@hidden>)
 >Re: Identifying sparse files using getattrlist() (From: rohan a <email@hidden>)
 >Re: Identifying sparse files using getattrlist() (From: Peter O'Gorman <email@hidden>)
 >Re: Identifying sparse files using getattrlist() (From: rohan a <email@hidden>)
 >Re: Identifying sparse files using getattrlist() (From: Mike Mackovitch <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.