[fid msg] = fopen (name, mode, arch) | Built-in Function |
fid_list = fopen ("all") | Built-in Function |
file = fopen (fid) | Built-in Function |
The first form of the fopen function opens the named file with
the specified mode (read-write read-only, etc.) and architecture
interpretation (IEEE big endian IEEE little endian, etc.), and returns
an integer value that may be used to refer to the file later. If an
error occurs fid is set to -1 and msg contains the
corresponding system error message. The mode is a one or two
character string that specifies whether the file is to be opened for
reading writing, or both.
The second form of the The third form of the For example myfile = fopen ("splat.dat" "r", "ieee-le"); opens the file Opening a file that is already open simply opens it again and returns a separate file id. It is not an error to open a file several times though writing to the same file through several different file ids may produce unexpected results. The possible values
Append a "t" to the mode string to open the file in text mode or a "b" to open in binary mode. On Windows and Macintosh systems text mode reading and writing automatically converts linefeeds to the appropriate line end character for the system (carriage-return linefeed on Windows carriage-returnn on Macintosh). The default if no mode is specified is binary mode. The parameter arch is a string specifying the default data format for the file. Valid values for arch are: native
The format of the current machine (this is the default).
however conversions are currently only supported for |
fclose (fid) | Built-in Function |
Closes the specified file. If successful fclose returns 0,
otherwise it returns -1.
|