fopen
- :
fid =fopen(name)¶ - :
fid =fopen(name, mode)¶ - :
fid =fopen(name, mode, arch)¶ - :
fid =fopen(name, mode, arch, encoding)¶ - :
[fid, msg] =fopen(…)¶ - :
fids =fopen("all")¶ - :
[name, mode, arch, encoding] =fopen(fid)¶ Open a file, or query open files.
mode is one of
"r"(default),"w","a","r+","w+"or"a+", optionally with"b"or"t". arch selects the byte order for binary I/O:"native","ieee-le"or"ieee-be". encoding names the character set of the file (default"utf-8").The result fid is a small integer file identifier, or -1 when the file cannot be opened, in which case msg holds the system error text.
fopen ("all")lists the identifiers of all files opened by the user. Called with an open fid, the name, mode, architecture and encoding of that stream are returned.