Mail Archives: djgpp-workers/2002/12/30/13:55:04
> Date: Mon, 30 Dec 2002 13:05:32 +0000
> From: "Richard Dawe" <rich AT phekda DOT freeserve DOT co DOT uk>
>
> There are a few solutions that I can see:
>
> (a) Set f_frsize to the same size as the cluster size. We pretend
> that the fundamental block size is the cluster size.
>
> This is the simplest solution. There's a patch below.
>
> (b) Modify the code to find the real sector size. Then scale
> the free block size numbers by (cluster size / sector size),
> to give the correct figures for free sectors.
>
> This method could be troublesome, unless we assume that
> cluster sizes are always equal to the sector size multiplied
> by a power of 2.
>
> *statvfs() use statfs() to get their information. Looking at
> the statfs code, it doesn't look like all the methods for finding
> disk space (CD-ROM, Windows '9x, Windows '9x other method) return
> the sector size. If not all the methods return the sector size,
> then this method can't really be used (we can only really support
> the "common lowest denominator").
>
> (c) Assume a 512 byte sector size and then scale the free block size
> numbers as in (b).
Ny vote is for b), unless it's very expensive or very tricky to
implement.
- Raw text -