• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Identifying sparse files using getattrlist()
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Identifying sparse files using getattrlist()


  • Subject: Re: Identifying sparse files using getattrlist()
  • From: Alastair Houghton <email@hidden>
  • Date: Tue, 3 Nov 2009 16:10:58 +0000

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)

st_blksize isn't what you think. Check the stat(2) man page, where you'll see it says:


     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. As short symbolic links are stored in the
inode, this number may be zero.


Kind regards,

Alastair.

--
http://alastairs-place.net



_______________________________________________
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>)

  • Prev by Date: Re: Identifying sparse files using getattrlist()
  • Next by Date: Re: Identifying sparse files using getattrlist()
  • Previous by thread: Re: Identifying sparse files using getattrlist()
  • Next by thread: Re: Identifying sparse files using getattrlist()
  • Index(es):
    • Date
    • Thread