Please note that the recommended version of Scilab is 6.1.0. This page might be outdated.
See the recommended documentation of this function
open a file
Dec 08, 2011 I tried using Matlab Coder to generate C code from my matlab code. I found that for some sort of functions such as 'plot'. We need to call them as the Matlab extrinsic function which means still we need Matlab on the computer to run the standalone executable file. Scilab can also be downloaded in source form, so that you can compile Scilab by yourself and produce your own binary. Compiling Scilab and generating a binary is especially interesting when we want to understand or debug an existing feature, or when we want to add a new feature. To compile Scilab, some prerequisites binary les are necessary.

a character string. The pathname of the file to open.
a character string that controls whether the file is opened for reading (r), writing (w), or appending (a) and whether the file is opened for updating (+). The mode can also include a b parameter to indicate a binary file.
a scalar. If swap is present and swap=0 then automatic bytes swap is disabled.
a scalar. Error indicator. see merror.

scalar. The fd parameter returned by the function mopen is used as a file descriptor (it's a positive integer).

mopen may be used to open a file in a way compatible with the C fopen procedure. Without swap argument the file is supposed to be coded in 'little endian IEEE format' and data are swaped if necessary to match the IEEE format of the processor.
The mode parameter controls the access allowed to the stream. The parameter can have one of the following values. In this list of values, the b character indicates a binary file
Opens the file for reading.
Opens a binary file for reading.
Opens a text file for reading.
Creates a new file for writing, or opens and truncates a file to zero length.
Creates a new binary file for writing, or opens and truncates a file to zero length.
Creates a text binary file for writing, or opens and truncates a file to zero length.
Appends (opens a file for writing at the end of the file, or creates a file for writing).
Opens a file for update (reading and writing).
Truncates to zero length or creates a file for update.
Appends (opens a file for update, writing at the end of the file, or creates a file for writing).
When you open a file for update, you can perform both input and output operations on the resulting stream. However, an output operation cannot be directly followed by an input operation without a file-positioning operation (mseek() function). Also, an input operation cannot be directly followed by an output operation without an intervening file positioning operation, unless the input operation encounters the end of the file.
When you open a file for append (that is, when the mode parameter is a or a+), it is impossible to overwrite information already in the file. You can use the fseek() function to reposition the file pointer to any position in the file, but when output is written to the file, the current file pointer is ignored. All output is written at the end of the file and the file pointer is repositioned to the end of the output.
To open files in a way compatible with Fortran like functions use function file.