<< filewrite | Stream manager | fprintf >> |
fid = fopen(filename) |
fid = fopen(filename, permission) |
[fid, msg] = fopen(filename) |
[fid, msg] = fopen(filename, permission) |
[fid, msg] = fopen(filename, permission, machinefmt, encoding) |
[filename, permission, machinefmt, encoding] = fopen(fid) |
fids = fopen('all') |
a string: filename to open
a string: permission applied on file: 'r', 'w', 'a', 'r+', 'a+'
a string: machine format applied on file: 'n' or 'native', 'b' or 'ieee-be', 'l' or 'ieee-le', 's' or 'ieee-be.l64', 'a' or 'ieee-le.l64'
a string: ccharacter encoding applied on file: 'UTF-8', 'ISO-8859-1', 'windows-1251', 'windows-1252', ...
an integer value: a file descriptor or -1 if there is an error.
a string: error message returned by fopen or ''.
a vector of integer values: list of files descriptor opened in Nelson.
fopen opens a file in Nelson.
functions fprintf, fgetl, fgets, fread, and fwrite use character encoding for subsequent read and write operations.
fid = fopen([tempdir(), filesep(), 'fopen_tst'], 'wt');
[filename, permission] = fopen(fid)
fids = fopen('all')
status = fclose(fd)
[filename, permission] = fopen(stdin)
[filename, permission] = fopen(stdout)
[filename, permission] = fopen(stderr)
characters encoding
TEXT_REF = 'Виртуальная';
filename = [tempdir(), 'fwrite_example_Windows-1251.txt'];
F = fopen(filename, 'wt', 'n', 'windows-1251');
W = fwrite(F, TEXT_REF, 'char')
fclose(F);
F = fopen(filename, 'rt', 'n', 'windows-1251');
TXT_READ = fread(F, '*char')
fclose(F);
Version | Description |
---|---|
1.0.0 | initial version |
Allan CORNET