Direct file I/O Unreliable in DOS or XENIX Pascal 3.30

Product Version(s):
Operating System:   XENIX
Flags: enduser |
Last Modified: 24-FEB-1988    ArticleIdent: Q11263

PRODUCT: Pascal/3.30
Problem:
If you open a DIRECT file, write to it, close it, open it again, SEEK to
one of the records you had previously written to, and attempt to PUT a new
value into that record, then this new value will not be placed there and
the directory length of the file is incorrect.
Response:
This problem exists in both Xenix and DOS Pascal.

A work-around for MS-DOS is available on request; user either links with
FILF.OBJ or replaces PASCAL.LIB with PASNEW.LIB.

Theoretically the fix under DOS 3.X is to open the file under any sharing
mode other than sm_compat or sm_denyrw to prevent Pascal from buffering the
file, however this may not be practical under MS-NET.

The problem does not occur if you do not close the file, i.e. you can open
a file, place values in the records and then seek to individual records and
write to them a second time to replace the previous value as often as you
wish until you first close the file.

PROGRAMMING WORK-AROUND:  First SEEK to record 256 and GET it before
SEEKing to the record you want to write to.

This problem was corrected in DOS Pascal version 3.31.
