I was called by a client that didn’t want to do maintenance on an old Delphi application, but wanted to get dir of an I/O Error 131:
I/O Error 131: ERROR_NEGATIVE_SEEK
MessageText: An attempt was made to move the file pointer before the beginning of the file.
Tough luck: psychic powers told me someone is using an unsigned 32-bit integer to access a file using traditional style Assign/Reset/Seek/Read/Close patterns that Delphi kept as intrinsic routines for Turbo Pascal backward compatibility, and that file has grown over 2 gigabyte in size.
I quickly found an import file had grown over the 2 gigabyte, so this was indeed the case.
The original developers didn’t do the file access using the 64-bit Seek/Position of the TStream descendant TFileStream.
Too bad, as now someone has to dig through the mothballs to find the sources (if they survived 3 different version control system switches), create a working development environment, and fix the bug.
Another instance where technical debt in IT raises its ugly head and the compound interest is really expensive.
–jeroen
via: erikmartin.com – IO Errors in Delphi.
Filed under: Delphi, Delphi 5, Development, Software Development, Technical Debt
