Re: Identifying sparse files using getattrlist()
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=T2jyp3LBn3ircylS9TShx6SIwg0zOHGrA3T2RCqViHQ=; b=w8R9BKjpnJoN/CuoLSwyCJcAcUgKJhI+GVUp56QVPr6QTX5FB6gtMYRG8yAFYdHsmc 9BTdzaPJS7Abc/G/jxy/cFD3jLt4c/+rlv7M4rSyqvjFpCvRBEVn9emqKacz8odVrukF PmSu812RXNJjJ8RiD5XXQgUx12ggoISUBrjtY= 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=F+xP8gh3qzJA2x1mibyQejOnO4GX2Tm3ZFaxp2NV8jnV5CWeWMEBs4V4eZq+NUPkhg V5NvTf3csY6GOyi241isBx+/T0w9BTsL6ot3jj/emhv4f4WelfKGdRZM7hFvfGiWWLXV RvSH/CxXRGajg5XA0JLKIG94yxrcIRkkmaO9I= Hello All, Please help me. Need it urgently. Thanks On Tue, Nov 3, 2009 at 4:34 PM, rohan a <info1686@gmail.com> wrote:
When I use # mkfile -nv 4g sparse on a 7GB Apple_UFS partition
df -k gives me this :
#df -k Filesystem 1024-blocks Used Available Capacity Mounted on /dev/disk2s3 7390568 40 7021000 1% /Volumes/UFSVolume
This indicates that the file created is sparse since it shows Capacity as 1%
On Tue, Nov 3, 2009 at 4:27 PM, Alastair Houghton <alastair@alastairs-place.net> wrote:
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.
_______________________________________________ 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
participants (1)
-
rohan a