| www.delorie.com/gnu/docs/octave/octave_106.html | search |
![]() Buy GNU books! | |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
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 fopen function returns a vector of file ids
corresponding to all the currently open files, excluding the
stdin, stdout, and stderr streams.
The third form of the fopen function returns the name of a
currently open file given its file id.
For example,
myfile = fopen ("splat.dat", "r", "ieee-le");
|
opens the file `splat.dat' for reading. If necessary, binary numeric values will be read assuming they are stored in IEEE format with the least significant bit first, and then converted to the native representation.
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 `mode' may have are
The parameter arch is a string specifying the default data format for the file. Valid values for arch are:
however, conversions are currently only supported for `native' `ieee-be', and `ieee-le' formats.
fclose returns
0. Otherwise, it returns 1.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
| webmaster donations bookstore | delorie software privacy |
| Copyright © 2003 by The Free Software Foundation | Updated Jun 2003 |