TempFileStream

Description:              This function uses the OS tmpfile() function to create a temporary file on disk and to connect a stream to the temporary file. The temporary file is removed when the stream is closed or no longer referenced or if the VTS process is terminated.

Returns:                    Stream

Usage:                       Script or Steady State

Format:                      TempFileStream(Buffer)

Parameters:             Buffer     { text }  { required }  { no default: }

                                                Any text or buffer expression. This serves as the initial content of the stream.

Comments:               This function returns a stream connected to a temporary disk file with the contents of Buffer; the pointer at which an action (read or write) commences will be at the start of the stream. Writing to this stream can overwrite and/or expand the size of this initial stream and file.

Example:

Stream = TempFileStream("0123456789");

The variable stream would contain "0123456789".

See Also:

BlockWrite | BuffStream | ClientSocket | CloseStream | FileStream | GetStreamLength | PipeStream | SRead | StreamEnd | SWrite