Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

FS

...

_

...

FILE  *FSFile_Open (CPU_CHAR  *name_full,

...

                       FS_FLAGS

...

   mode
                       FS_ERR    *p_err);

...

...

File

...

Called from

...

...

Code enabled by

...

rowspan2

...

fs_file.c

...

...

Application;

...

fs_fopen()

...

rowspan2

...

N/A

...

Anchor10933901093390Open a file. Anchor10933911093391

See fs_fopen() for more information. Anchor11052591105259

Arguments

...

name_full Anchor11430941143094

Name of the file. See section 4-3 “μC/FS File and Directory Names and Paths”

...

for information about file names.

...

1093394mode Anchor11431011143101

File access mode (see Notes #1 and #2).

...

1104128p_err Anchor11431081143108

Pointer to variable that will the receive return error code from this function:

...

classWebWorks_Indent_1

...

FS_ERR_NONE

...

...

File opened.

...

...

FS_ERR_NAME_NULL

...

classWebWorks_Indent_2

...

Argument name_full passed a NULL pointer.

...

Or entry error (see Section B.04).

...

Returned Value

...

10934011093401None. Anchor11006451100645

Notes/Warnings

...

...

classWebWorks_Indent_1

...

FS_FILE_ACCESS_MODE_RD

...

...

File opened for reads.

...

classWebWorks_Indent_1

...

FS_FILE_ACCESS_MODE_WR

...

...

classWebWorks_Indent_2

...

File opened for writes.

...

...

FS_FILE_ACCESS_MODE_CREATE

...

...

classWebWorks_Indent_2

...

File will be created, if necessary.

...

classWebWorks_Indent_1

...

FS_FILE_ACCESS_MODE_TRUNC

...

...

File length will be truncated to 0.

...

...

FS_FILE_ACCESS_MODE_APPEND

...

classWebWorks_Indent_2

...

All writes will be performed at EOF.

...

classWebWorks_Indent_1

...

...

FS_FILE_ACCESS_MODE_EXCL

...

classWebWorks_Indent_2

...

File will be opened if and only if it does not already exist.

...

classWebWorks_Indent_1

...

FS_FILE_ACCESS_MODE_CACHED

...

...

File data will be cached.

...

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

...

Table A-1 fs_fopen() mode strings and mode equivalents.