[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: DOS 3.3 disk usage
In article <Pine.GSO.4.64.0707092319100.14400@halifax.chebucto.ns.ca>,
Simon D. Williams <email@ld8.org> wrote:
> Hello,
> I've been messing around with DOS 3.3, which is somewhat unknown territory
> for me... anyway, I moved a bunch of files from a ProDOS volume to a DOS
> 3.3 diskette using Copy II+ and was surprised to find that the files seem
> to be using up a lot more disk space than [I think] they should. Most of
> the files are exactly 1024 bytes long, but they use 6 blocks on disk... is
> this normal for DOS or is Copy II+ causing the anomaly?
> TIA,
> -s
They use 6 _sectors_ on the disk, where each sector is 256 bytes.
Still, your 1024 byte file consumes 1536 bytes of disk space though, i.e.
two excess sectors apart from the 4 sectors needed to store the actual data.
This is for two reasons:
1. The file must, if it's a binary file, also store the start address
(2 bytes) and the length (another 2 bytes) of your 1024 byte file. If
it's an Applesoft Basic file, only the length (2 bytes) needs to be stored
apart from the actual file data. So DOS 3.3 needs to store nut just 1024
bytes on the disk, but 1026 bytes (Applesoft file) or 1028 bytes (binary
file) on the disk. This requires three 256-byte sectors.
2. Each DOS 3.3 has an associated track-sector list, which tells DOS 3.3
which sectors belong to that file. The track-sector list requires a minimum
of one sector but may require several sectors. This of course also means
that even if you create a minimal file containing just one byte of data,
it will require two sectors of disk space: one sector for the file data
(and associated header), and a second sector for the track-sector list.
--
----------------------------------------------------------------
Paul Schlyter, Grev Turegatan 40, SE-114 38 Stockholm, SWEDEN
e-mail: pausch at stockholm dot bostream dot se
WWW: http://stjarnhimlen.se/