Class RawFile (unit ODFileUnit) |
TObject
RawFile implements simple binary file with seeking & locking abilities. It is used to implement the other file classes.
Constructors |
Functions |
Get current position.
Lock a range of bytes
Seek in file, returning new position.
RawFile error messaging
Properties |
Events |
Variables |
Constructors |
------------------------------------------------------------------------------ RawFile methods ------------------------------------------------------------------------------ Create new RawFile
Functions |
Close the file. It is always safe to call Close, even on an already closed file.
Close RawFile
Destroy RawFile, closing disk image first.
Return current read/write position in file
Get current position. This involves seeking to end of file & then back again and could therefore be slow.
Perform region locking/unlocking
Lock a range of bytes
Open a file, possibly creating it. See above for the various modes.
Open RawFile. Most of this is mapping my modes onto Windows modes. Calling this on an already open file will Close & then re-open it.
Read nbytes from file into buffer pointed to by buf. Returns actual number of bytes read, which may be less than nbytes. If the number of bytes read is zero, then the end of file has been reached.
Read bytes from file
Seek in a file
Seek in file, returning new position. Raises exception if seek fails.
Unlock a range of bytesa
Write nbytes to file from buffer pointed to by buf.
Write bytes to file
is it open?
RawFile error messaging
Properties |
Accessors for file name and open state
Events |
Variables |
windows file handle
full name of file