|
Rockbox mail archiveSubject: Re: Status reportRe: Status report
From: <Matt.OReilly_at_wachovia.com>
Date: Wed, 8 May 2002 15:44:35 -0400 Is it really that complicated? I may not understand the problem, but here's a thought. I haven't looked into FAT32 at all, but I thought that in FAT16 the end of each cluster there was a reserved space populated with the address of the next cluster. Putting them back in order was one of the features of vopt/norton defrag/etc. because when the files were contiguous after the optimization, there was a whole lot less overhead to find each piece. So it would seem to me, following this (perhaps flawed) logic, that we could get by by only moving the first portion of the cluster of the new file to a new location and linking back to the second cluster through the FAT32 addressing. (Hmmm, maybe that's how fragmentation got started...) We would lose a lot of space depending on how often this was done between defrags (which I think would have to be run fairly often if this was used a lot), but I *think* it would mean that we would only have to copy the contents of one cluster to a new cluster, and not rewrite the whole file. I think that's what Phil was trying to say. Or maybe not. :-) Matt "Paul Suade" <paul.suade_at_lapo To: <rockbox_at_cool.haxx.se> ste.net> cc: Sent by: Subject: Re: Status report owner-rockbox_at_co ol.haxx.se 05/08/2002 01:54 PM Please respond to rockbox Each file has a start CLUSTER, that is the start point is not per sector unit but a fix power-of-two group of sectors (ususally 8 sectors for a 4-KB cluster)... FAT files are in fact are not a bunch of sectors but a bunch of clusters. If FAT16 files were only on sectors basis, FAT16 partitions on harddisk would not be able to handle more than 65520 sectors, so clusters as a group of sectors were introduced to help a FAT16 partition to work with larger harddisk. Anyway, the only solution to split a file is truncating the first file after recopying byte after byte the rest of the first file in a second file. ----- Original Message ----- From: perterm <perterm_at_vce.de> To: <rockbox_at_cool.haxx.se> Sent: Wednesday, May 08, 2002 6:44 PM Subject: Re: Status report Björn Stenberg wrote: > And finally, the disk i/o code is now ready. The ATA driver, FAT32 driver, > directory handling layer and file layer are tested and green-flagged for > use. The usual case would be that we want to split a file somewhere right in the middle of a sector of the disc. Assume the situation that we want to split a file that uses sector 1 - 3 and we want to split the file within sector 2. splitpoint V |xxxxxxxxxx|xxxxxxxxxx|xxxxxxx---|----------| sector 1 sector 2 sector 3 sector 4 x : used by the file - : free space | : sector boundaries Our goal is to obtain two files: FileA and FileB. This probably means that the content of sector 2 has to be duplicated to be used in both files. In this example we copy the content of sector 2 to sector 4. FileA consists of sector 1;2 and FileB of sector 4;3. endpoint FileA startpoint FileB V V |xxxxxxxxxx|xxxxx-----|xxxxxxx---|-----xxxxx| sector 1 sector 2 sector 3 sector 4 But now the startpoint of FileB is in the middle of sector 4. Is somehting like this possible with FAT? Or must each file start at a sector boundary? And if so - does the mp3 file format allow to fill the empty space with dummy data? Still wished I had time to do more than questions... Phil Received on 2002-05-08 Page template was last modified "Tue Sep 7 00:00:02 2021" The Rockbox Crew -- Privacy Policy |