Siebel eScript Language Reference > Siebel eScript Commands > The Clib Object >

Clib.freopen() Method


This method closes the file associated with a file pointer and then opens a file and associates it with the file pointer of the file that has been closed.

Syntax

Clib.freopen(filename, mode, oldFilePointer)

Parameter
Description
filename
The name of a file to be opened
mode
One of the file modes specified in the Clib.fopen() function; for Unicode, the same "u" flag as in Clib.fopen can be used
oldFilePointer
The file pointer to a file to be closed, and to which filename is to be associated

Returns

A copy of the old file pointer after reassignment, or null if the function fails.

Usage

This method closes the file associated with oldFilePointer (ignoring any close errors) and then opens filename according to mode (as in Clib.fopen()) and reassociates oldFilePointer to this new file specification. It is commonly used to redirect one of the predefined file handles (stdout, stderr, stdin) to or from a file.

See Also

Clib.fclose() Method and Clib.fopen() Method


 Siebel eScript Language Reference 
 Published: 18 April 2003