FSFile_Open()
FS_FILE *FSFile_Open (CPU_CHAR *name_full,
FS_FLAGS mode
FS_ERR *p_err);
File |
Called from |
Code enabled by |
fs_file.c |
Application; fs_fopen() |
N/A |
Open a file.
See fs_fopen() for more information.
Arguments
name_full
Name of the file. See section 4-3 “μC/FS File and Directory Names and Paths” on page 62 for information about file names.
mode
File access mode (see Notes #1 and #2).
p_err
Pointer to variable that will the receive return error code from this function:
Or entry error (see Section B.04).
Returned Value
None.
Notes/Warnings
The access mode should be the logical OR of one or more flags :
If FS_FILE_ACCESS_MODE_TRUNC is set, then FS_FILE_ACCESS_MODE_WR must also be set.
If FS_FILE_ACCESS_MODE_EXCL is set, then FS_FILE_ACCESS_MODE_CREATE must also be set.
FS_FILE_ACCESS_MODE_RD and/or FS_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 of fs_fopen() mode strings are shown in Table 5-4.
fopen() Mode String |
mode Equivalent |
“r” or “rb” |
FS_FILE_ACCESS_MODE_RD |
“w” or “wb” |
FS_FILE_ACCESS_MODE_WR | |
“a” or “ab” |
FS_FILE_ACCESS_MODE_WR | |
“r+” or “rb+” or “r+b” |
FS_FILE_ACCESS_MODE_RD | |
“w+” or “wb+” or “w+b” |
FS_FILE_ACCESS_MODE_RD | |
“a+” or “ab+” or “a+b” |
FS_FILE_ACCESS_MODE_RD | FS_FILE_ACCESS_MODE_WR | FS_FILE_ACCESS_MODE_APPEND |
-
- fs_fopen() mode strings and mode equivalents.