X-Git-Url: http://cloudbase.mooo.com/gitweb/z180-stamp.git/blobdiff_plain/7b78a5a287827db9e9b16286f3604aef69b37c5c..70702af1370e44e32fb2c3c507e4759a187b4fe5:/fatfs/doc/en/open.html diff --git a/fatfs/doc/en/open.html b/fatfs/doc/en/open.html index d61a7a4..feade15 100644 --- a/fatfs/doc/en/open.html +++ b/fatfs/doc/en/open.html @@ -27,20 +27,20 @@ FRESULT f_open (

Parameters

fp
-
Pointer to the blank file object structure to be created.
+
Pointer to the blank file object structure.
path
-
Pointer to a null-terminated string that specifies the file name to open or create.
+
Pointer to the null-terminated string that specifies the file name to open or create.
mode
Mode flags that specifies the type of access and open method for the file. It is specified by a combination of following flags.
- - + + - + +
ValueDescription
FA_READSpecifies read access to the object. Data can be read from the file. Combine with FA_WRITE for read-write access.
ValueMeaning
FA_READSpecifies read access to the object. Data can be read from the file.
FA_WRITESpecifies write access to the object. Data can be written to the file. Combine with FA_READ for read-write access.
FA_OPEN_EXISTINGOpens the file. The function fails if the file is not existing. (Default)
FA_OPEN_ALWAYSOpens the file if it is existing. If not, a new file is created.
-To append data to the file, use f_lseek() function after file open in this method.
FA_CREATE_NEWCreates a new file. The function fails with FR_EXIST if the file is existing.
FA_CREATE_ALWAYSCreates a new file. If the file is existing, it will be truncated and overwritten.
FA_OPEN_ALWAYSOpens the file if it is existing. If not, a new file will be created.
FA_OPEN_APPENDSame as FA_OPEN_ALWAYS except read/write pointer is set end of the file.
@@ -74,15 +74,15 @@ To append data to the file, use f_lseek() func

Description

-

After f_open() function succeeded, the file object is valid. The file object is used for subsequent read/write functions to identify the file. To close an open file, use f_close() function. If the file is modified and not closed properly, the file data will be collapsed.

-

If duplicated file open is needed, read here carefully. However duplicated open of a file with write mode flag is always prohibited.

-

Before using any file function, a work area (file system object) must be registered to the logical drive with f_mount() function. All API functions except for f_fdisk() function can work after this procedure.

+

Before using any file function, a work area (file system object) needs to be registered to the logical drive with f_mount function. All API functions except for f_mkfs/f_fdisk function get ready to work after this procedure.

+

After f_open function succeeded, the file object is valid. The file object is used for subsequent operations to the file to identify the file. Open file must be closed prior to power down, media removal or re-mount, or the file can be collapsed. To close an open file, use f_close function.

+

If duplicated file open is needed, read here carefully. However duplicated open of a file with any write mode flag is always prohibited.

QuickInfo

-

Always available. The mode flags, FA_WRITE, FA_CREATE_ALWAYS, FA_CREATE_NEW and FA_OPEN_ALWAYS, are not available when _FS_READONLY == 1.

+

Always available. Only FA_READ and FA_OPEN_EXISTING are supported when _FS_READONLY == 1.

@@ -134,11 +134,11 @@ int main (void) f_mount(&fs[1], "1:", 0); /* Open source file on the drive 1 */ - fr = f_open(&fsrc, "1:file.bin", FA_OPEN_EXISTING | FA_READ); + fr = f_open(&fsrc, "1:file.bin", FA_READ); if (fr) return (int)fr; /* Create destination file on the drive 0 */ - fr = f_open(&fdst, "0:file.bin", FA_CREATE_ALWAYS | FA_WRITE); + fr = f_open(&fdst, "0:file.bin", FA_WRITE | FA_CREATE_ALWAYS); if (fr) return (int)fr; /* Copy source to destination */