Bookshelf Home | Contents | Index | Search | PDF | ![]() ![]() ![]() ![]() |
Siebel eScript Language Reference > Siebel eScript Commands > The Clib Object >
File I/O Functions
Siebel eScript handles file I/O in a manner similar to C and C++. In these languages, files are never read from, or written to, directly. Rather, you must first open a file, most commonly by passing its name to the Clib.fopen() function. (You can also open a file using Clib.tmpfile().) These functions read the file into a buffer in memory and return a file pointer—a pointer to the beginning of the buffer. The data in the buffer is often referred to as a file stream, or simply a stream. Reading and writing occurs relative to the buffer, which is not written to disk unless you explicitly flush the buffer with Clib.fflush() or close the file with Clib.fclose().
Clib supports the following file I/O functions:
NOTE: Siebel applications use UTF-16 encoding when writing to a file in Unicode. The first two bytes of the file are always the BOM (Byte Order Mark). When Clib.rewind is called on such a file, it is pointing to the BOM (-257) and not the first valid character. The user can call Clib.fgetc/getc once to skip the BOM.
Bookshelf Home | Contents | Index | Search | PDF | ![]() ![]() ![]() ![]() |
Siebel eScript Language Reference Published: 18 April 2003 |