| **Navigation:**  [[introduction.htm|Language Reference]] > 13 - Built-in Functions >====== STREAM (enable operating system buffering) ====== | [[stop suspend program execution .htm|{{btn_prev_n.gif|Previous page}}]][[introduction.htm|{{btn_home_n.gif|Return to chapter overview}}]][[strpos return matching value position .htm|{{btn_next_n.gif|Next page}}]] | | || **STREAM(**//file//**)** {{blk2blue.jpg|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 flush buffers .htm|FLUSH]] [[logout begin transaction .htm|LOGOUT]] [[buffer set record paging .htm|BUFFER]]