dev builds
themes manual
device status forums
mailing lists
IRC bugs
dev guide

Rockbox mail archive

Subject: Re: disk write testing

Re: disk write testing

From: Björn Stenberg <>
Date: Wed, 6 Nov 2002 21:49:17 +0100

Greg Haerr wrote:
> I'll show you by submitting a patch that greatly cleans up the madness
> in file.c

Sounds good. I'm curious to see how you've solved it.

> Lseek shouldn't be mucking around performing data file i/o, other than
> chasing down the cluster chain (which doesn't work, see below).

Actually it does work. You seem to be reading old code.

> Why is seeksector decremented as the first statement?

Quoting the source:

    if (seeksector) {
        /* we need to find the sector BEFORE the requested, since
           the file struct stores the last accessed sector */
This behaviour was changed from how the fat code used to work. Before write was added, the fat_file struct stored nextsector. Now it stores lastsector.

The reason for the change is that we cannot store nextsector when writing, since it would mean allocating a new cluster before we know if we need one.

Received on 2002-11-06

Page template was last modified "Tue Sep 7 00:00:02 2021" The Rockbox Crew -- Privacy Policy