We have some ancient Delphi code (might have even originated as Turbo Pascal code) that uses {$I-}
, aka {$
IOCHECKS
OFF}
, which makes the code use IOResult instead of exceptions for disk I/O errors.
I want to get rid of the {$I-}
and bring this code forward into the 1990s, but to do that, I'd like to know what all is affected by {$IOCHECKS OFF}
. Does this only affect the crufty old built-in I/O functions like AssignFile / Reset / Rewrite / Append / CloseFile? Or does it affect more modern things like TFileStream as well? More importantly, what else might be affected that I'm not thinking of? (Delphi Basics suggests that it also affects MkDir and RmDir. If it affects those, there have to be more.)
The Delphi 2007 Help topic "Input output checking (Delphi)" (ms-help://borland.bds5/devcommon/compdirsinput_outputchecking_xml.html
) says that this affects "I/O procedure[s]", and that "I/O procedures are described in the Delphi Language Guide." This doesn't help much, since CodeGear has never shipped a Language Guide, and the last time Borland shipped one was Delphi 5.
Which functions and classes behave differently under {$I-}
?
EDIT: The accepted answer gives some great background, but here's the quick summary in alphabetized list form: {$IOCHECKS OFF}
only affects the following routines from the System unit.
- Append
- BlockRead
- BlockWrite
- ChDir
- CloseFile
- Eof
- Eoln
- Erase
- FilePos
- FileSize
- Flush
- MkDir
- Read
- Readln
- Rename
- Reset
- Rewrite
- RmDir
- Seek
- SeekEof
- SeekEoln
- SetLineBreakStyle
- Truncate
- Write
- Writeln