Unit ODFileUnit

------------------------------------------------------------------------------ ODFileUnit.Pas Copyright (C) 1997 Object Dynamics Ltd. // This unit implements classes supporting file I/O using Win32 I/O functions, and a "C-like" I/O style. It is intended to be somewhat easier to use than the built-in Pascal file I/O mechanisms. // // *** IMPORTANT *** // By using this code, you accept the following conditions: // You may use and adapt this code freely, but it remains the copyright of Object Dynamics Ltd. Any adaptations must retain the copyright message at the head of this file. // You use this code at your own risk. Object Dynamics is not responsible for any loss or damage caused by programs using this code. // // History: // Version 1.0 Created by Neil Butterworth, September 1997 Fixed problems with file create modes, November 1997. // ------------------------------------------------------------------------------

Classes

RandomAccessFile - This class supports random access to fixed-sized records.
RawFile - RawFile implements simple binary file with seeking & locking abilities.
TextFile - The TextFile class implements access to files consisting of lines of text.
TFBuffer - Text file buffer.

Functions

Types

FileCreateOption
FileHandle
FileOpenMode
FileSeekFrom
FileShareMode
TextFileOpenMode
TextFileShareMode

Constants

Variables


Functions


Types


FileCreateOption = ( fcNew, 				// always creates a new file
   							fcExisting, 		// file must already exist
                        fcAlways          // file will be created if it doesn't
                        						// exist, else it will be opened
                       );
file can be shared for any access
FileHandle = integer
Windows file handle
FileOpenMode = ( 	foRead,					// open file read-only
   						foWrite,           	// open file write-only
                     foReadWrite        	// open for both
   					);
Raw file modes
FileSeekFrom = ( 	sfStart, 				// seek from start
   						sfEnd, 					// seek from end
                     sfHere 					// seek from current position
                   );
file will be created if it doesn't exist, else it will be opened
FileShareMode = ( fsNoShare,           // file cannot be shared
   						fsShareRead, 			// file can be shared for reading
                     fsShareWrite, 			// file can be shared for writing
                     fsShared					// file can be shared for any access
   					);
open for both
TextFileOpenMode = ( toRead, 				// open for reading
   							toReWrite, 			// open for overwrite existing contents
                        toAppend 			// open for append to existing contents
                       );
Text file modes
TextFileShareMode = ( smShare,         // open shared (for read only)
                         smNoShare        // open single user
                        );
open for append to existing contents

Constants


Variables