You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The cc65 lseek (and thus, fseek) for atari only works on Sparta DOS X, since the NOTE/POINT system available on other DOS'es are insufficiently expressive to implement it (since they speak Sectors and Byte offsets, rather than offsets from file begin/end). This limits its usefulness compared to the rest of the atari POSIX file compat library.
The text was updated successfully, but these errors were encountered:
intfseek(FILE*stream, longoffset, intorigin)
{
switch (origin) {
caseSEEK_CUR:
if (offset >= 0)
SKIP(offset);
elsereturnfseek(stream, current_pos+offset, SEEK_SET);
break;
caseSEEK_SET:
rewind(stream); // either POINT or CLOSE+OPENSKIP(offset);
break;
caseSEEK_END:
file_size=current_pos+SKIP_UNTIL_EOF();
if (offset<0)
returnfseek(stream, file_size+offset, SEEK_SET);
break;
}
}
This is of course slow on large files, but standard Atari DOSes read the whole file in order to delete or replace it, so users should be patient enough. :)
One problem is that we cannot SKIP (nor SKIP_UNTIL_EOF) on files open in write-only mode.
Meh, generally the ethos behind the C library has been to present a standard interface to functionality already present in the underlying system. This is a stretch along those lines, and it would have a dramatically different time complexity than one would typically expect.
The cc65
lseek
(and thus,fseek
) foratari
only works on Sparta DOS X, since the NOTE/POINT system available on other DOS'es are insufficiently expressive to implement it (since they speak Sectors and Byte offsets, rather than offsets from file begin/end). This limits its usefulness compared to the rest of theatari
POSIX file compat library.The text was updated successfully, but these errors were encountered: