User Tools

Site Tools


stream_enable_operating_system_buffering_.htm
Navigation:  Language Reference > 13 - Built-in Functions >====== STREAM (enable operating system buffering) ====== Previous pageReturn to chapter overviewNext page

STREAM(file)

blk2blue.jpg

STREAM Disables automatic FILE flushing.
file The label of a FILE.

Some file systems flush the operating system's buffers on each disk write keeping the file “logically closed” (for example, the Clarion and TopSpeed file drivers do this by default). The STREAM statement disables this automatic flushing operation. A STREAM operation is terminated by closing the file, which automatically flushes the buffers, or by issuing a FLUSH statement.

STREAM and FLUSH are inherently single-user, batch process type of statements, although you can use them in networked environments. In some file systems, STREAM and FLUSH are simply ignored when the file is opened for shared access while in others they execute but it is possible to create a “deadlock” situation between workstations for multiple file updates. LOGOUT accomplishes a similar purpose in multi-user environments and is much safer.

Support for this statement is dependent upon the file system and is described in its file driver's documentation.

Example:

STREAM(History)        !Use DOS buffering

SET(Current)           !Set to top of current file

LOOP

 NEXT(Current)

 IF ERRORCODE() THEN BREAK END

 His:Record = Cur:Record

 ADD(History)

END

FLUSH(History)        !End streaming, flush buffers

See Also:

FLUSH

LOGOUT

BUFFER

stream_enable_operating_system_buffering_.htm.txt · Last modified: 2021/04/15 15:57 (external edit)