Versions Compared

Key

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


...

Code Block
languagecpp
FS_FILE  *FSFile_Open (CPU_CHAR  *name_full,

...


                       FS_FLAGS

...

   mode
                       FS_ERR    *p_err);

...

class
HTML Table
summary
Plain_Table
Table Row (tr)
Table Cell (td)
Anchor
11109241110924


File

...

Called from

...

...

Code enabled by

...

...

fs_file.c

...

rowspan2

...

...

Application;

...

...

fs_fopen()

...

rowspan2

...

...

N/A

...

Anchor10933901093390Open a file. Anchor

10933911093391See fs_fopen() for  for more information.anchor11052591105259

Arguments

...

name_fullanchor11430941143094

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 Anchor11431081143108

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

...

classWebWorks_Indent_1

...

FS_ERR_NONE

...

...

classWebWorks_Indent_2

...

File opened.

...

classWebWorks_Indent_1

...

FS_ERR_NAME_NULL

...

...

classWebWorks_Indent_2

...

Argument name_full passed a NULL pointer.

...

Or entry error (see

...

µC/FS Error Codes).

...

Returned Value

...

1093401None. Anchor11006451100645

Notes/Warnings

...

  1. The access mode should be the logical OR of one or more flags :

...

classWebWorks_Indent_1

...

  1. FS_FILE_ACCESS_MODE_RD

...

...

  1. File opened for reads.

...

...

classWebWorks_Indent_1

...

  1. FS_FILE_ACCESS_MODE_WR

...

...

  1. File opened for writes.

...

classWebWorks_Indent_1

...

...

  1. FS_FILE_ACCESS_MODE_CREATE

...

classWebWorks_Indent_2

...

...

  1. File will be created, if necessary.

...

...

  1. FS_FILE_ACCESS_MODE_TRUNC

...

classWebWorks_Indent_2

...

...

  1. File length will be truncated to 0.

...

classWebWorks_Indent_1

...

  1. FS_FILE_ACCESS_MODE_APPEND

...

classWebWorks_Indent_2

...

...

  1. All writes will be performed at EOF.

...

classWebWorks_Indent_1

...

  1. FS_FILE_ACCESS_MODE_EXCL

...

...

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

...

classWebWorks_Indent_1

...

  1. FS_FILE_ACCESS_MODE_CACHED

...

classWebWorks_Indent_2

...

...

  1. File data will be cached.

...


  1. If FS_FILE_ACCESS_MODE_TRUNC is set, then FS_FILE_ACCESS_MODE_WR must also be set.

...

  1. If FS_FILE_ACCESS_MODE_EXCL is set, then FS_FILE_ACCESS_MODE_CREATE must also be set.

...

  1. FS_FILE_ACCESS_MODE_RD and/or FS_FILE_ACCESS_MODE_WR must be set.

...

...

  1. 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

...

  1. the table below.

    fopen() Mode String

...

...

  1. mode Equivalent

...

  1. “r” or “rb”

...

  1. FS_FILE_ACCESS_MODE_RD

...

...

  1. “w” or “wb”

...

  1. FS_FILE_ACCESS_MODE_WR |
    FS_FILE_ACCESS_MODE_CREATE |
    FS_FILE_ACCESS_MODE_TRUNC

...

...

  1. “a” or “ab”

...

  1. FS_FILE_ACCESS_MODE_WR |
    FS_FILE_ACCESS_MODE_CREATE |
    FS_FILE_ACCESS_MODE_APPEND

...

  1. “r+” or “rb+” or “r+b”

...

  1. FS_FILE_ACCESS_MODE_RD |
    FS_FILE_ACCESS_MODE_WR

...

...

  1. “w+” or “wb+” or “w+b”

...

...

  1. FS_FILE_ACCESS_MODE_RD |
    FS_FILE_ACCESS_MODE_WR |
    FS_FILE_ACCESS_MODE_CREATE |
    FS_FILE_ACCESS_MODE_TRUNC

...

  1. “a+” or “ab+” or “a+b”

...

...

  1. FS_FILE_ACCESS_MODE_RD |

...

  1. FS_FILE_ACCESS_MODE_WR |
    FS_FILE_ACCESS_MODE_CREATE |

...

...

  1. FS_FILE_ACCESS_MODE_APPEND

...

  1. Anchor10934291093429 fs_fopen() mode strings and mode equivalents.