A script-enabled browser is required for this page to function properly.

TEXT_IO.Fopen

Description

Opens the designated file in the specified mode.

Syntax


FUNCTION Text_IO.Fopen
   (spec     VARCHAR2,
    filemode VARCHAR2)
RETURN Text_IO.File_Type;

Parameters

Parameter Description
spec A case-insensitive string corresponding to a file's name.
filemode

A single case-insensitive character that specifies the mode in which to open the file, and consists of one of the following characters:

R Open the file for reading only.
W Open the file for reading and writing after deleting all existing lines in the file.
A Open the file for reading and writing without deleting existing lines (i.e., appending).

Returns

A handle to the specified file.

Example


 /*
** Declare two local variables to represent two files:
** one to read from, the other to write to.
*/
in_file   Text_IO.File_Type;
out_file  Text_IO.File_Type;
in_file  := Text_IO.Fopen('salary.txt', 'r');
out_file := Text_IO.Fopen('bonus.txt', 'w');