Re: Identifying sparse files using getattrlist()
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=yA4ktUM6Fg7ktLP1gcBZH1kkzXU=; b=oEHPlxEL/UT9rzT3cuuKkA SlJsIOQeznlpsfDi0Y/KHv7IUINj7MKSfO1Xp9dbEXJf3V1e5p7KADtLSnXvlqEZ GxoaVu/J4aFW/AXl8/iraBkXQk8JDorAU6LVPM3v1xSKt5dlrusGvcwZxkI3Bae0 7gwLiny+/LDCC50cAyrlw= 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 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... 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. This email sent to site_archiver@lists.apple.com
participants (1)
-
Alastair Houghton