| |||
| Home > RealView Debugger Predefined Macros > Alphabetical predefined macro reference > fopen | |||
Opens a file for reading, writing, or both.
int fopen (fileid, file_name, mode)
int fileid;
char *file_name;
char *mode;
where:
fileidAn ID number for the file that is opened. This must
be a user-defined .
See Window and file numbers for details.fileid
file_nameA string pointer identifying the name of the file you want to open. If you specify a hardcoded filename you must enclose it in double quotes. See Rules for specifying filenames for details on how to specify filenames that include a path.
modeStandard C-style file mode.
intOne of the following:
-1Failure
fileidSuccess, the ID number of the opened file is returned.
Follow these rules when specifying a filename:
Filenames must be in double quotes, for example "myfiles/file".
Filenames containing a backslash must be in double
quotes, with each backslash escaped. For example, “c:\\myfiles\\file”.
The example on Example also
shows you how to use fopen in a macro.