...
Code Block | ||
---|---|---|
| ||
FS_FILE *FSFile_Open (CPU_CHAR *name_full, |
...
FS_FLAGS |
...
mode FS_ERR *p_err); |
...
HTML Table | |||||||
---|---|---|---|---|---|---|---|
summary | classPlain_Table | ||||||
Table Row (tr) | |||||||
Table Cell (td) | |||||||
Anchor | 1110924 | 1110924 |
File |
---|
...
Called from |
---|
...
...
Code enabled by |
---|
...
...
|
...
rowspan | 2 |
---|
...
...
Application; |
...
...
|
...
rowspan | 2 |
---|
...
...
N/A |
...
Anchor
fs_fopen()
for for more information.anchorArguments
...
name_full
anchor
Name of the file. See
...
the sub-topic "µC/FS File and Directory Names and
...
Paths" in the topic Useful Information.
mode
File access mode (see Notes
...
).
...
p_err
1143108 Anchor
Pointer to variable that will the receive return error code from this function:
...
class | WebWorks_Indent_1 |
---|
...
FS_ERR_NONE
...
...
class | WebWorks_Indent_2 |
---|
...
File opened.
...
class | WebWorks_Indent_1 |
---|
...
FS_ERR_NAME_NULL
...
...
class | WebWorks_Indent_2 |
---|
...
Argument name_full
passed a NULL pointer.
...
Or entry error (see
...
...
Returned Value
...
Notes/Warnings
...
The access mode should be the logical OR of one or more flags :
...
class | WebWorks_Indent_1 |
---|
...
FS_FILE_ACCESS_MODE_RD
...
...
File opened for reads.
...
...
class | WebWorks_Indent_1 |
---|
...
FS_FILE_ACCESS_MODE_WR
...
...
File opened for writes.
...
class | WebWorks_Indent_1 |
---|
...
...
FS_FILE_ACCESS_MODE_CREATE
...
class | WebWorks_Indent_2 |
---|
...
...
File will be created, if necessary.
...
...
FS_FILE_ACCESS_MODE_TRUNC
...
class | WebWorks_Indent_2 |
---|
...
...
File length will be truncated to 0.
...
class | WebWorks_Indent_1 |
---|
...
FS_FILE_ACCESS_MODE_APPEND
...
class | WebWorks_Indent_2 |
---|
...
...
All writes will be performed at EOF.
...
class | WebWorks_Indent_1 |
---|
...
FS_FILE_ACCESS_MODE_EXCL
...
...
File will be opened if and only if it does not already exist.
...
class | WebWorks_Indent_1 |
---|
...
FS_FILE_ACCESS_MODE_CACHED
...
class | WebWorks_Indent_2 |
---|
...
...
File data will be cached.
...
- If
FS_FILE_ACCESS_MODE_TRUNC
is set, thenFS_FILE_ACCESS_MODE_WR
must also be set.
...
- If
FS_FILE_ACCESS_MODE_EXCL
is set, thenFS_FILE_ACCESS_MODE_CREATE
must also be set.
...
FS_FILE_ACCESS_MODE_RD
and/orFS_FILE_ACCESS_MODE_WR
must be set.
...
...
The mode string argument of
fs_fopen()
function can specify a subset of the possible valid modes for this function. The equivalent modes offs_fopen()
mode strings are shown in
...
the table below.
fopen() Mode String
...
...
mode Equivalent
...
“r” or “rb”
...
FS_FILE_ACCESS_MODE_RD
...
...
“w” or “wb”
...
FS_FILE_ACCESS_MODE_WR |
FS_FILE_ACCESS_MODE_CREATE |
FS_FILE_ACCESS_MODE_TRUNC
...
...
“a” or “ab”
...
FS_FILE_ACCESS_MODE_WR |
FS_FILE_ACCESS_MODE_CREATE |
FS_FILE_ACCESS_MODE_APPEND
...
“r+” or “rb+” or “r+b”
...
FS_FILE_ACCESS_MODE_RD |
FS_FILE_ACCESS_MODE_WR
...
...
“w+” or “wb+” or “w+b”
...
...
FS_FILE_ACCESS_MODE_RD |
FS_FILE_ACCESS_MODE_WR |
FS_FILE_ACCESS_MODE_CREATE |
FS_FILE_ACCESS_MODE_TRUNC
...
“a+” or “ab+” or “a+b”
...
...
FS_FILE_ACCESS_MODE_RD |
...
FS_FILE_ACCESS_MODE_WR |
FS_FILE_ACCESS_MODE_CREATE |
...
...
FS_FILE_ACCESS_MODE_APPEND
...
Anchor 1093429 1093429 fs_fopen() mode strings and mode equivalents.