Fenix Manual
Fenix Manual
Command Reference
File Commands

Cd
Chdir
Fclose
Feof
Fgets
File
File_Exists
Flength
Fopen
Fputs
Fread
Fseek
Ftell
Fwrite
Glob
Mkdir
Rmdir

Fopen
Last Modified: May 30, 2005 00:05AM
(Any)
Description

INT FOPEN(STRING FILE, INT TYPE)

PARAMETERS:
file: Name of the file to open or to create
type: It indicates if the file must be opened for reading or be created or be truncated. It can be one of the following constants:
O_READ: Reading.
O_WRITE: Scripture.
O_READWRITE: Read/write.
O_ZREAD: Reading of compressed files.
O_ZWRITE: Creation of compressed files.

DESCRIPTION:
This function opens a disc file, and gives back a file identifier that must be used with the functions of access to disc (Fread, Fwrite, etc) in any later operation with him.

When opening a file in way O_WRITE, this one will be created if it exists previously, and truncated to size 0 if it already had data previously. The same he is applicable to way O_ZWRITE.

When opening a file with O_ZREAD, these functions are not valid Flength nor Fseek (this last one will be emulated, but considering that in a compressed file can only be advanced, to back down nor never to go directly at the end of the file). With O_ZWRITE these two functions are never valid nor can be emulated.

In case that the file cannot be opened, Fopen will give back 0. This will happen for example if the file does not exist in a reading way. All the files opened with Fopen must obligatorily close with the function Fclose, specially with the files opened in way writing (it is possible that it leaves from the file is only written really in disc at the time of closing it with Fclose, being left the file incomplete if he were not asi ').

User Contributed Notes
Fopen
Add Notes About Notes
There are no user contributed notes for this page.
Last updated: Tue, 24 May 2005 - 16:34:52

Manual © 2005 By Gary Moncrieff(Dazzy), Notes belong to their respective posters