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



On 2 Nov 2009, at 13:37, rohan a wrote:

I am trying to identify if a particular file is a sparse file using
getattrlist()

I am using this :     attrList.fileattr    = ATTR_FILE_TOTALSIZE |
ATTR_FILE_ALLOCSIZE;

According to the man page if  ATTR_FILE_ALLOCSIZE <
ATTR_FILE_TOTALSIZE the file is a sparse file.

I created the sparse file using dd
#dd if=/dev/zero of=sparse-file bs=1 count=0 seek=3g

However, both AllocSize and TotalSize are returning the same size
while actually AllocSize < TotalSize

I am using UFS

Does Apple UFS even support sparse files? Remember, UFS is a name used by a fair number of totally different and usually incompatible filesystems. I haven't really ever bothered investigating exactly what Apple's UFS can and can't do... indeed, I've always had the impression that it was only really present for the benefit of old-time NeXT users who might have compatible filesystems floating around already.


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



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.