From 75e1e7a5e26491e942fb2b25f518d8e2e3112721 Mon Sep 17 00:00:00 2001 From: inmarket Date: Fri, 15 Aug 2014 02:22:02 +1000 Subject: Add GFILE support for PetitFS (a very tiny FAT implementation) --- 3rdparty/petitfs-0.03/doc/pf/open.html | 103 +++++++++++++++++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 3rdparty/petitfs-0.03/doc/pf/open.html (limited to '3rdparty/petitfs-0.03/doc/pf/open.html') diff --git a/3rdparty/petitfs-0.03/doc/pf/open.html b/3rdparty/petitfs-0.03/doc/pf/open.html new file mode 100644 index 00000000..2914467f --- /dev/null +++ b/3rdparty/petitfs-0.03/doc/pf/open.html @@ -0,0 +1,103 @@ + + + + + + + + +Petit FatFs - pf_open + + + + +
+

pf_open

+

The pf_open function opens an existing file.

+
+FRESULT pf_open (
+  const char* path  /* [IN] Pointer to the file neme */
+);
+
+
+ +
+

Parameters

+
+
path
+
Pointer to a null-terminated string that specifies the file name to open.
+
+
+ + +
+

Return Values

+
+
FR_OK (0)
+
The function succeeded.
+
FR_NO_FILE
+
Could not find the file or path.
+
FR_DISK_ERR
+
The function failed due to a hard error in the disk function, a wrong FAT structure or an internal error.
+
FR_NOT_ENABLED
+
The volume has not been mounted.
+
+
+ + +
+

Description

+

The file must be opend prior to use pf_read() and pf_lseek() function. The open file is valid until next open.

+
+ + +
+

Example

+
+int main (void)
+{
+    FATFS fs;          /* Work area (file system object) for the volume */
+    BYTE buff[16];     /* File read buffer */
+    UINT br;           /* File read count */
+    FRESULT res;       /* Petit FatFs function common result code */
+
+
+    /* Mount the volume */
+    pf_mount(&fs);
+    if (res) die(res);
+
+    /* Open a file */
+    res = pf_open("srcfile.dat");
+    if (res) die(res);
+
+    /* Read data to the memory */
+    res = pf_read(buff, 16, &br);    /* Read data to the buff[] */
+    if (res) die(res);               /* Check error */
+    if (br != 16) die(255);          /* Check EOF */
+
+    ....
+
+    /* Forward data to the outgoing stream */
+    do
+        res = pf_read(0, 512, &br);  /* Send data to the stream */
+    while (res || br != 512);        /* Break on error or eof */
+
+    ....
+
+}
+
+
+ +
+

QuickInfo

+

Always available.

+
+ +
+

References

+

pf_read, FATFS

+
+ +

Return

+ + -- cgit v1.2.3