Re: [cc65] ftell and fseek unavailable on c64?

Date view Thread view Subject view

From: Groepaz (
Date: 2003-11-19 22:13:11

On Wednesday 19 November 2003 18:22, Stephan Lesch wrote:
> On Wed, 19 Nov 2003, carlos wrote:
> > Hello,
> >
> > i think that this is not right, because every sector has two bytes
> > pointing to the next sector of the file.
> > So one could seek 254 bytes at one time.
> If you're writing your own disk routines anyway, it's not too difficult to
> do - you could scan the sector chain of a file when it's opened, (or just
> scan the link pointers of the whole disk), and update this table when new
> sectors are added. It would take maybe 10 seconds for the whole disk,
> and then allow you to access any position in any file without
> reading it from the start.
> But neither your proposal nor mine are compatible with the file handling
> in the kernel, the floppy and the C runtime, that's the real
> problem I think...

seeking forward in steps of sector size would work just fine on c64, and 
not clash with the kernel would however still not be really 
fast, and it doesnt solve the backward-seeking problem at all.

i implemented seeking in my posix directory routines for c64...and eventhough
it seeks through very little data there (only a few sectors on a full directory)
its very very slowish :=P


To unsubscribe from the list send mail to with
the string "unsubscribe cc65" in the body(!) of the mail.

Date view Thread view Subject view

This archive was generated by hypermail 2.1.3 : 2003-11-19 22:22:17 CET