Re: How to read files from disk directly?
Re: How to read files from disk directly?
- Subject: Re: How to read files from disk directly?
- From: Ken Hornstein <email@hidden>
- Date: Sun, 03 Jul 2011 23:49:53 -0400
>But, if I am using public APIs to obtain the information, I would assume
>it would remain somewhat stable. I would assume that defragmentation
>applications have to do something similar to this and they seem to
>remain somewhat stable, but perhaps I am mistaken.
Well, from a _quick_ glance at the xnu source, the only API I could
find which does that is F_LOG2PHYS. And as for defragmentation ...
do people still _do_ that anymore? HFS Plus will auto-defrag files
under 20 MB and the whole point to extents were to cut down on
fragmentation. I see there are still some defragmentation utilities,
but I would guess that they simply access the disk directly and
have to know about the HFS Plus volume format.
>Nice. I was not aware of the F_LOG2PHYS option of fcntl. What are the
>other system calls that would get me all of the physical block offsets?
>Or is that what you describe below?
I think that's it, unless you directly access the disk device and
read the catalog, which is what fsck_hfs does (again, from a super-quick
glance).
--Ken
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Filesystem-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden