[Overview][Constants][Types][Classes][Procedures and functions][Variables] Reference for unit 'Objects' (#rtl)

TBufStream.Init

Initialize an instance of TBufStreamand open the file.

Declaration

Source position: objects.pp line 344

constructor TBufStream.Init(

  FileName: FNameStr;

  Mode: Word;

  Size: Word

);

Description

Initinstantiates an instance of TBufStream. The name of the file that contains (or will contain) the data of the stream is given in FileName. The Modeparameter determines whether a new file should be created and what access rights you have on the file. It can be one of the following constants:

stCreate
Creates a new file.
stOpenRead
Read access only.
stOpenWrite
Write access only.
stOpen
Read and write access.

The Sizeparameter determines the size of the buffer that will be created. It should be different from zero.

For an example see TBufStream.Flush.

Errors

On error, Statusis set to stInitError, and ErrorInfois set to the dos error code.

See also

TDosStream.Init

  

Instantiate a new instance of TDosStream.

TBufStream.Done

  

Close the file and cleans up the instance.