From 1d10fbd56e4d55028d997db92fe8b6e6fbb6353d Mon Sep 17 00:00:00 2001 From: YuanHongbin <975559679@qq.com> Date: Mon, 22 Jun 2026 11:37:51 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E6=B8=85=E7=90=86FatFS=E5=86=97?= =?UTF-8?q?=E4=BD=99=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LICENSE.txt | 24 - documents/00index_e.html | 149 - documents/css_e.css | 73 - documents/doc/appnote.html | 339 - documents/doc/chdir.html | 88 - documents/doc/chdrive.html | 70 - documents/doc/chmod.html | 89 - documents/doc/close.html | 65 - documents/doc/closedir.html | 64 - documents/doc/config.html | 304 - documents/doc/dinit.html | 46 - documents/doc/dioctl.html | 101 - documents/doc/dread.html | 73 - documents/doc/dstat.html | 48 - documents/doc/dwrite.html | 76 - documents/doc/eof.html | 62 - documents/doc/error.html | 62 - documents/doc/expand.html | 117 - documents/doc/fattime.html | 80 - documents/doc/fdisk.html | 95 - documents/doc/filename.html | 94 - documents/doc/findfirst.html | 118 - documents/doc/findnext.html | 69 - documents/doc/forward.html | 139 - documents/doc/getcwd.html | 83 - documents/doc/getfree.html | 94 - documents/doc/getlabel.html | 90 - documents/doc/gets.html | 65 - documents/doc/lseek.html | 139 - documents/doc/mkdir.html | 80 - documents/doc/mkfs.html | 127 - documents/doc/mount.html | 122 - documents/doc/open.html | 185 - documents/doc/opendir.html | 75 - documents/doc/printf.html | 115 - documents/doc/putc.html | 60 - documents/doc/puts.html | 61 - documents/doc/rc.html | 135 - documents/doc/read.html | 80 - documents/doc/readdir.html | 139 - documents/doc/rename.html | 87 - documents/doc/sdir.html | 38 - documents/doc/setcp.html | 82 - documents/doc/setlabel.html | 92 - documents/doc/sfatfs.html | 62 - documents/doc/sfile.html | 43 - documents/doc/sfileinfo.html | 78 - documents/doc/size.html | 62 - documents/doc/stat.html | 112 - documents/doc/tell.html | 62 - documents/doc/truncate.html | 66 - documents/doc/unlink.html | 74 - documents/doc/utime.html | 99 - documents/doc/write.html | 80 - documents/res/app1.c | 44 - documents/res/app2.c | 81 - documents/res/app3.c | 109 - documents/res/app4.c | 315 - documents/res/app5.c | 38 - documents/res/app6.c | 61 - documents/res/f1.png | Bin 1414 -> 0 bytes documents/res/f2.png | Bin 1458 -> 0 bytes documents/res/f3.png | Bin 1039 -> 0 bytes documents/res/f4.png | Bin 1973 -> 0 bytes documents/res/f5.png | Bin 2224 -> 0 bytes documents/res/f6.png | Bin 1464 -> 0 bytes documents/res/f7.png | Bin 25760 -> 0 bytes documents/res/funcs.png | Bin 26839 -> 0 bytes documents/res/layers.png | Bin 5521 -> 0 bytes documents/res/layers1.png | Bin 3843 -> 0 bytes documents/res/layers2.png | Bin 4950 -> 0 bytes documents/res/layers3.png | Bin 2379 -> 0 bytes documents/res/mkfatimg.zip | Bin 778875 -> 0 bytes documents/res/mkfs.xlsx | Bin 1491997 -> 0 bytes documents/res/modules.png | Bin 15396 -> 0 bytes documents/res/rwtest1.png | Bin 69114 -> 0 bytes documents/res/rwtest2.png | Bin 8153 -> 0 bytes documents/res/rwtest3.png | Bin 3011 -> 0 bytes documents/res/uniconv.zip | Bin 4175 -> 0 bytes documents/updates.html | 481 - ff15.zip | Bin 2379894 -> 0 bytes source/00history.txt | 369 - source/00readme.txt | 21 - source/diskio.c | 233 - source/diskio.h | 77 - source/ff.c | 7085 --------------- source/ff.h | 429 - source/ffconf.h | 296 - source/ffsystem.c | 223 - source/ffunicode.c | 15593 --------------------------------- source/sd_diskio.c | 204 - source/sd_diskio.h | 26 - 92 files changed, 30817 deletions(-) delete mode 100644 LICENSE.txt delete mode 100644 documents/00index_e.html delete mode 100644 documents/css_e.css delete mode 100644 documents/doc/appnote.html delete mode 100644 documents/doc/chdir.html delete mode 100644 documents/doc/chdrive.html delete mode 100644 documents/doc/chmod.html delete mode 100644 documents/doc/close.html delete mode 100644 documents/doc/closedir.html delete mode 100644 documents/doc/config.html delete mode 100644 documents/doc/dinit.html delete mode 100644 documents/doc/dioctl.html delete mode 100644 documents/doc/dread.html delete mode 100644 documents/doc/dstat.html delete mode 100644 documents/doc/dwrite.html delete mode 100644 documents/doc/eof.html delete mode 100644 documents/doc/error.html delete mode 100644 documents/doc/expand.html delete mode 100644 documents/doc/fattime.html delete mode 100644 documents/doc/fdisk.html delete mode 100644 documents/doc/filename.html delete mode 100644 documents/doc/findfirst.html delete mode 100644 documents/doc/findnext.html delete mode 100644 documents/doc/forward.html delete mode 100644 documents/doc/getcwd.html delete mode 100644 documents/doc/getfree.html delete mode 100644 documents/doc/getlabel.html delete mode 100644 documents/doc/gets.html delete mode 100644 documents/doc/lseek.html delete mode 100644 documents/doc/mkdir.html delete mode 100644 documents/doc/mkfs.html delete mode 100644 documents/doc/mount.html delete mode 100644 documents/doc/open.html delete mode 100644 documents/doc/opendir.html delete mode 100644 documents/doc/printf.html delete mode 100644 documents/doc/putc.html delete mode 100644 documents/doc/puts.html delete mode 100644 documents/doc/rc.html delete mode 100644 documents/doc/read.html delete mode 100644 documents/doc/readdir.html delete mode 100644 documents/doc/rename.html delete mode 100644 documents/doc/sdir.html delete mode 100644 documents/doc/setcp.html delete mode 100644 documents/doc/setlabel.html delete mode 100644 documents/doc/sfatfs.html delete mode 100644 documents/doc/sfile.html delete mode 100644 documents/doc/sfileinfo.html delete mode 100644 documents/doc/size.html delete mode 100644 documents/doc/stat.html delete mode 100644 documents/doc/tell.html delete mode 100644 documents/doc/truncate.html delete mode 100644 documents/doc/unlink.html delete mode 100644 documents/doc/utime.html delete mode 100644 documents/doc/write.html delete mode 100644 documents/res/app1.c delete mode 100644 documents/res/app2.c delete mode 100644 documents/res/app3.c delete mode 100644 documents/res/app4.c delete mode 100644 documents/res/app5.c delete mode 100644 documents/res/app6.c delete mode 100644 documents/res/f1.png delete mode 100644 documents/res/f2.png delete mode 100644 documents/res/f3.png delete mode 100644 documents/res/f4.png delete mode 100644 documents/res/f5.png delete mode 100644 documents/res/f6.png delete mode 100644 documents/res/f7.png delete mode 100644 documents/res/funcs.png delete mode 100644 documents/res/layers.png delete mode 100644 documents/res/layers1.png delete mode 100644 documents/res/layers2.png delete mode 100644 documents/res/layers3.png delete mode 100644 documents/res/mkfatimg.zip delete mode 100644 documents/res/mkfs.xlsx delete mode 100644 documents/res/modules.png delete mode 100644 documents/res/rwtest1.png delete mode 100644 documents/res/rwtest2.png delete mode 100644 documents/res/rwtest3.png delete mode 100644 documents/res/uniconv.zip delete mode 100644 documents/updates.html delete mode 100644 ff15.zip delete mode 100644 source/00history.txt delete mode 100644 source/00readme.txt delete mode 100644 source/diskio.c delete mode 100644 source/diskio.h delete mode 100644 source/ff.c delete mode 100644 source/ff.h delete mode 100644 source/ffconf.h delete mode 100644 source/ffsystem.c delete mode 100644 source/ffunicode.c delete mode 100644 source/sd_diskio.c delete mode 100644 source/sd_diskio.h diff --git a/LICENSE.txt b/LICENSE.txt deleted file mode 100644 index a9e57a9..0000000 --- a/LICENSE.txt +++ /dev/null @@ -1,24 +0,0 @@ -FatFs License - -FatFs has being developped as a personal project of the author, ChaN. It is free from the code anyone else wrote at current release. Following code block shows a copy of the FatFs license document that heading the source files. - -/*----------------------------------------------------------------------------/ -/ FatFs - Generic FAT Filesystem Module Rx.xx / -/-----------------------------------------------------------------------------/ -/ -/ Copyright (C) 20xx, ChaN, all right reserved. -/ -/ FatFs module is an open source software. Redistribution and use of FatFs in -/ source and binary forms, with or without modification, are permitted provided -/ that the following condition is met: -/ -/ 1. Redistributions of source code must retain the above copyright notice, -/ this condition and the following disclaimer. -/ -/ This software is provided by the copyright holder and contributors "AS IS" -/ and any warranties related to this software are DISCLAIMED. -/ The copyright owner or contributors be NOT LIABLE for any damages caused -/ by use of this software. -/----------------------------------------------------------------------------*/ - -Therefore FatFs license is one of the BSD-style licenses, but there is a significant feature. FatFs is mainly intended for embedded systems. In order to extend the usability for commercial products, the redistributions of FatFs in binary form, such as embedded code, binary library and any forms without source code, do not need to include about FatFs in the documentations. This is equivalent to the 1-clause BSD license. Of course FatFs is compatible with the most of open source software licenses include GNU GPL. When you redistribute the FatFs source code with changes or create a fork, the license can also be changed to GNU GPL, BSD-style license or any open source software license that not conflict with FatFs license. diff --git a/documents/00index_e.html b/documents/00index_e.html deleted file mode 100644 index eed6244..0000000 --- a/documents/00index_e.html +++ /dev/null @@ -1,149 +0,0 @@ - - -
- - - - - - - -
-FatFs is a generic FAT/exFAT filesystem module for small embedded systems. The FatFs module is written in compliance with ANSI C (C89) and completely separated from the disk I/O layer. Therefore it is independent of the platform. It can be incorporated into small microcontrollers with limited resource, such as 8051, PIC, AVR, ARM, Z80, RX and etc. Also Petit FatFs module for tiny microcontrollers is available here.
- -
-FatFs provides various filesystem functions for the applications as shown below.
-
-Since FatFs module is the Filesystem Layer independent of platforms and storage media, it is completely separated from the physical devices, such as memory card, harddisk and any type of storage device. The storage device control module is not any part of FatFs module and it needs to be provided by implementer. FatFs controls the storage devices via a simple media access interface shown below. Also sample implementations for some platforms are available in the downloads. A function checker for storage device control module is available here.
-The FatFs module is a free software opened for education, research and development. You can use, modify and/or redistribute it for any purpose without any restriction under your responsibility. For further information, refer to the application note.
-The FatFs module assumes following conditions on portability.
-Integer types used in FatFs are defined in ff.h as described below. It is based on Win32 API (windef.h). This will not be a problem on most platform. When a conflict with existing definitions occured, you must resolve it with care.
-The dependency diagram shown below is a typical, but not specific, configuration of the embedded system with FatFs module.
-
(a) If a working disk module for FatFs is provided, nothing else will be needed. (b) To attach existing disk drivers with different interface, some glue functions are needed to translate the interfaces between FatFs and the driver.
-
You need to provide only MAI functions required by FatFs module and nothing else. If a working device control module for the target system is available, you need to write only glue functions to attach it to the FatFs module. If not, you need to port another device control module or write it from scratch. Most of MAI functions are not that always required. For instance, the write function is not required in read-only configuration. Following table shows which function is required depends on the configuration options.
-| Function | Required when: | Note |
|---|---|---|
| disk_status disk_initialize disk_read | Always | Disk I/O functions. Samples available in ffsample.zip. There are many implementations on the web. |
| disk_write get_fattime disk_ioctl (CTRL_SYNC) | FF_FS_READONLY == 0 | |
| disk_ioctl (GET_SECTOR_COUNT) disk_ioctl (GET_BLOCK_SIZE) | FF_USE_MKFS == 1 | |
| disk_ioctl (GET_SECTOR_SIZE) | FF_MAX_SS != FF_MIN_SS | |
| disk_ioctl (CTRL_TRIM) | FF_USE_TRIM == 1 | |
| ff_uni2oem ff_oem2uni ff_wtoupper | FF_USE_LFN != 0 | Unicode support functions. Add optional module ffunicode.c to the project. |
| ff_mutex_create ff_mutex_delete ff_mutex_take ff_mutex_give | FF_FS_REENTRANT == 1 | O/S dependent functions. Sample code is available in ffsystem.c. |
| ff_mem_alloc ff_mem_free | FF_USE_LFN == 3 |
FatFs cares about neither what kind of storage device is used nor how it is implemented. Only a requirement is that it is a block device read/written in fixed-size blocks that accessible via the disk I/O functions defined above.
-The memory usage varies depends on the configuration options.
-| ARM7 32bit | ARM7 Thumb | CM3 Thumb-2 | AVR | H8/300H | PIC24 | RL78 | V850ES | SH-2A | RX600 | IA-32 | |
|---|---|---|---|---|---|---|---|---|---|---|---|
| Compiler | GCC | GCC | GCC | GCC | CH38 | C30 | CC78K0R | CA850 | SHC | RXC | MSC |
| .text (Def, R/W) | 10.4k | 6.7k | 6.1k | 12.5k | 11.0k | 11.4k | 13.0k | 8.9k | 9.2k | 6.5k | 8.9k |
| .text (Min, R/W) | 7.0k | 4.7k | 4.2k | 8.5k | 7.6k | 7.9k | 9.5k | 6.3k | 6.4k | 4.7k | 6.4k |
| .text (Def, R/O) | 4.9k | 3.2k | 2.7k | 6.1k | 5.2k | 5.4k | 6.5k | 4.3k | 4.2k | 3.2k | 4.3k |
| .text (Min, R/O) | 3.7k | 2.5k | 2.1k | 4.4k | 4.0k | 4.2k | 5.1k | 3.4k | 3.3k | 2.5k | 3.5k |
| .bss | V*4 + 2 | V*4 + 2 | V*4 + 2 | V*2 + 2 | V*4 + 2 | V*2 + 2 | V*2 + 2 | V*4 + 2 | V*4 + 2 | V*4 + 2 | V*4 + 2 |
| Work area (FF_FS_TINY == 0) | V*564 + F*552 | V*564 + F*552 | V*564 + F*552 | V*560 + F*546 | V*560 + F*546 | V*560 + F*546 | V*560 + F*546 | V*564 + F*552 | V*564 + F*552 | V*564 + F*552 | V*564 + F*552 |
| Work area (FF_FS_TINY == 1) | V*564 + F*40 | V*564 + F*40 | V*564 + F*40 | V*560 + F*34 | V*560 + F*34 | V*560 + F*34 | V*560 + F*34 | V*564 + F*40 | V*564 + F*40 | V*564 + F*40 | V*564 + F*40 |
These are the memory usage of FatFs module without lower layer on some target systems in following condition. V denotes number of mounted volumes and F denotes number of open files. Every samples here are optimezed in code size.
--FatFs R0.15 options: -FF_FS_READONLY 0 (R/W, read/write) or 1 (R/O, read only) -FF_FS_MINIMIZE 0 (Def, with all basic functions) or 3 (Min, with fully minimized) -FF_FS_TINY 0 (Default) or 1 (Tiny file object) -And any other options are left unchanged from original setting. --
Follwing table shows which API function is removed by configuration options to reduce the module size. To use an API function, the row of the function must be clear.
-| Function | FF_FS_ MINIMIZE | FF_FS_ READONLY | FF_USE_ STRFUNC | FF_FS_ RPATH | FF_USE_ FIND | FF_USE_ CHMOD | FF_USE_ EXPAND | FF_USE_ LABEL | FF_USE_ MKFS | FF_USE_ FORWARD | FF_MULTI_ PARTITION | ||||||||||||||
| 0 | 1 | 2 | 3 | 0 | 1 | 0 | 1 | 0 | 1 | 2 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 1 | |
| f_mount | |||||||||||||||||||||||||
| f_open | |||||||||||||||||||||||||
| f_close | |||||||||||||||||||||||||
| f_read | |||||||||||||||||||||||||
| f_write | x | ||||||||||||||||||||||||
| f_sync | x | ||||||||||||||||||||||||
| f_lseek | x | ||||||||||||||||||||||||
| f_opendir | x | x | |||||||||||||||||||||||
| f_closedir | x | x | |||||||||||||||||||||||
| f_readdir | x | x | |||||||||||||||||||||||
| f_findfirst | x | x | x | ||||||||||||||||||||||
| f_findnext | x | x | x | ||||||||||||||||||||||
| f_stat | x | x | x | ||||||||||||||||||||||
| f_getfree | x | x | x | x | |||||||||||||||||||||
| f_truncate | x | x | x | x | |||||||||||||||||||||
| f_unlink | x | x | x | x | |||||||||||||||||||||
| f_mkdir | x | x | x | x | |||||||||||||||||||||
| f_rename | x | x | x | x | |||||||||||||||||||||
| f_chdir | x | ||||||||||||||||||||||||
| f_chdrive | x | ||||||||||||||||||||||||
| f_getcwd | x | x | |||||||||||||||||||||||
| f_chmod | x | x | |||||||||||||||||||||||
| f_utime | x | x | |||||||||||||||||||||||
| f_getlabel | x | ||||||||||||||||||||||||
| f_setlabel | x | x | |||||||||||||||||||||||
| f_expand | x | x | |||||||||||||||||||||||
| f_forward | x | ||||||||||||||||||||||||
| f_mkfs | x | x | |||||||||||||||||||||||
| f_fdisk | x | x | x | ||||||||||||||||||||||
| f_putc | x | x | |||||||||||||||||||||||
| f_puts | x | x | |||||||||||||||||||||||
| f_printf | x | x | |||||||||||||||||||||||
| f_gets | x | ||||||||||||||||||||||||
FatFs module supports the long file name (LFN) extension of the FAT filesystem. The two different file names, short file name (SFN) and LFN, of a file is transparent on the API. The support for LFN feature is disabled by default. To enable the LFN, set FF_USE_LFN to 1, 2 or 3, and add ffunicode.c to the project. The LFN feature requiers a certain working buffer. The buffer size can be configured by FF_MAX_LFN according to the available memory. The length of LFN can be up to 255 characters, so that the FF_MAX_LFN should be set to 255 for any existing file names. If the size of working buffer is insufficient for the input file name, the file function fails with FR_INVALID_NAME. When use any re-entry to the API with LFN feature in RTOS environment, FF_USE_LFN must be set to 2 or 3. In this case, the file function allocates the working buffer on the stack or heap. The LFN working buffer occupies (FF_MAX_LFN + 1) * 2 bytes and additional (FF_MAX_LFN + 44) / 15 * 32 bytes when exFAT is enabled.
-| FF_CODE_PAGE | Code size |
|---|---|
| 437-869 (SBCS) | +3.3k |
| 932 (Japanese) | +62k |
| 936 (Simplified Chinese) | +177k |
| 949 (Korean) | +140k |
| 950 (Traditional Chinese) | +111k |
| 0 (All code pages) | +486k |
When the LFN is enabled, the module size will be increased depends on the configured code page. Right table shows the increment of code size in some code pages. Especially, in the CJK region, tens of thousands of characters are being used. Unfortunately, it requires a huge OEM-Unicode bidirectional conversion table and the module size will be drastically increased as shown in the table.
-As the result, the FatFs with LFN enabled with DBCS code pages will not able to be ported on the most 8-bit MCU systems. If the target system is in legacy-free, in only Unicode and any ANSI/OEM code is not used at all, the code page setting gets meaningless. You will able to reduce the code size by configureing FatFs for Unicode API with any SBCS code page.
-There ware some restrictions on using LFN for open source project, because the LFN extension on the FAT filesystem was a patent of Microsoft Corporation. However the related patents all have expired and using the LFN feature is free for any projects.
-By default, FatFs uses ANSI/OEM code set on the API even in LFN configuration. FatFs can also switch the character encoding on the API to Unicode by configuration option FF_LFN_UNICODE. This means that FatFs is compliant with the full featured LFN specification. The data type TCHAR specifies path name strings on the API is an alias of either char(ANSI/OEM or UTF-8), WCHAR(UTF-16) or DWORD(UTF-32) depends on that option. For more information, refer to the description in the file name.
-Note that setting of code page, FF_CODE_PAGE, has actually no meaning when FatFs is configured for the Unicode API. It should be set 437 to reduce the module size. However it still affects code conversion of string I/O functions when FF_STRF_ENCODE == 0, and also backward compatibility with legacy systems. In this case, the code page may need to be configured properly if it is considered a problem.
-The exFAT (Microsoft's Extended File Allocation Table) filesystem is a succession of the FAT/FAT32 filesystem which has been widely used in embedded systems, consumer devices and portable storage media. It is adopted by SDA (SD Association) as the filesystem for SDXC card, 64 GB and larger, and they are being shipped with this format. Therefore the exFAT is one of the standard filesystems for removable media as well as FAT. The exFAT filesystem allows the file size beyond the 4 GB limit what FAT filesystem allows up to and some filesystem overhead, especially cluster allocation delay, are reduced as well. These features allow to record the large data without dividing into some files and improve the write throughput to the file.
-Note that the exFAT filesystem is a patent of Microsoft Corporation. The exFAT feature of FatFs is an implementation based on US. Pat. App. Pub. No. 2009/0164440 A1. FatFs module can switch the exFAT on or off by a configuration option, FF_FS_EXFAT. When enable the exFAT for the commercial products, a license by Microsoft will be needed depends on the final destination of the products.
-Remarks: Enabling exFAT discards C89 compatibility and it wants C99 because of need for 64-bit integer type.
-LBA (Logical Block Addressing) is an addressing method to specify the location of data block, called sector, on the storage media. It is a simple linear address beginning from 0 as the first sector, 1 as the second sector and so on. The host system does not need to consider how the data block is located and managed in the storage device. FatFs supports only LBA for the media access. 32-bit LBA is a common size in the most LBA scheme. It can address up to 232 sectors, 2 TB in 512 bytes/sector. When a storage device larger than 2 TB is used, larger sector size or 64-bit LBA will be needed to address the entire sectors of the storage device.
-By default, FatFs works in 32-bit LBA for media access. FatFs can also switch it to 64-bit LBA by a configuration option FF_LBA64. It also enables GPT (GUID Partition Table) for partiotion management on the storage device. For further information about GPT, refer to f_mkfs and f_fdisk function.
-The file operations of two tasks to the different volumes each other is always re-entrant and it can work concurrently without any mutual exclusion regardless of the configurations except when LFN is enabled with static working buffer (FF_USE_LFN = 1).
-The file operations of two tasks to the same volume is not thread-safe by default. FatFs can also be configured to make it thread-safe by an option FF_FS_REENTRANT. When a file function is called while the volume is being accessed by another task, the file function to the volume will be suspended until that task leaves the file function. If the wait time exceeded a period defined by FF_TIMEOUT, the file function will abort with FR_TIMEOUT. The timeout feature might not be supported on the some OSs. To enable this feature, OS dependent synchronization control functions, ff_mutex_create/ff_mutex_delete/ff_mutex_take/ff_mutex_give, need to be added to the project. There is an example code in the ffsystem.c for some OSs.
-Note that there is an exception on the re-entrancy for f_mount and f_mkfs function. You will know why it is. These volume management functions are always not thread-safe to the volume being processed. When use these functions, other tasks need to avoid to access the corresponding volume.
-| Function | Case 1 | Case 2 | Case 3 |
|---|---|---|---|
| disk_status | Yes | Yes | Yes(*) |
| disk_initialize | No | Yes | Yes(*) |
| disk_read | No | Yes | Yes(*) |
| disk_write | No | Yes | Yes(*) |
| disk_ioctl | No | Yes | Yes(*) |
| get_fattime | No | Yes | Yes |
Remarks: This section describes on the re-entrancy of the FatFs module itself. The FF_FS_REENTRANT option enables only exclusive use of each filesystem objects and FatFs does not that prevent to re-enter the storage device control functions. Thus the device control layer needs to be always thread-safe when FatFs API is re-entered for different volumes. Right table shows which control function can be re-entered when FatFs API is re-entered on some conditions.
-FatFs module does not support the read/write collision control of duplicated open to a file. The duplicated open is permitted only when each of open method to a file is read mode. The duplicated open with one or more write mode to a file is always prohibited, and also open file must not be renamed or deleted. A violation of these rules can cause data collaption.
-The file lock control can be enabled by FF_FS_LOCK option. The value of option defines the number of open objects to manage simultaneously. In this case, if any opening, renaming or removing against the file shareing rule that described above is attempted, the file function will be rejected with FR_LOCKED. If number of open objects, files and sub-directories, is equal to FF_FS_LOCK, an extra f_open/f_opendir function will fail with FR_TOO_MANY_OPEN_FILES.
-For good read/write throughput on the small embedded systems with limited size of memory, application programmer should consider what process is done in the FatFs module. The file data on the volume is transferred in following sequence by f_read function.
-Figure 1. Sector unaligned read (short)
-
-
Figure 2. Sector unaligned read (long)
-
-
Figure 3. Fully sector aligned read
-
-
The file I/O buffer is a sector buffer to read/write a part of data on the sector. The sector buffer is either file private sector buffer on each file object or shared sector buffer in the filesystem object. The buffer configuration option FF_FS_TINY determins which sector buffer is used for the file data transfer. When tiny buffer configuration (1) is selected, data memory consumption is reduced FF_MAX_SS bytes each file object. In this case, FatFs module uses only a sector buffer in the filesystem object for file data transfer and FAT/directory access. The disadvantage of the tiny buffer configuration is: the FAT data cached in the sector buffer will be lost by file data transfer and it must be reloaded at every cluster boundary. However it will be suitable for most application from view point of the decent performance and low memory comsumption.
-Figure 1 shows that a partial sector, sector unaligned part of the file, is transferred via the file I/O buffer. At long data transfer shown in Figure 2, middle of transfer data that covers one or more sector is transferred to the application buffer directly. Figure 3 shows that the case of entier transfer data is aligned to the sector boundary. In this case, file I/O buffer is not used. On the direct transfer, the maximum extent of sectors are read with disk_read function at a time but the multiple sector transfer is divided at cluster boundary even if it is contiguous.
-Therefore taking effort to sector aligned read/write accesss eliminates buffered data transfer and the read/write performance will be improved. Besides the effect, cached FAT data will not be flushed by file data transfer at the tiny configuration, so that it can achieve same performance as non-tiny configuration with small memory footprint.
-To maximize the write performance of flash memory media, such as SDC, CFC and U Disk, it must be controlled in consideration of its characteristitcs.
-
-The write throughput of the flash memory media becomes the worst at single sector write transaction. The write throughput increases as the number of sectors per a write transaction as shown in Figure 6. This effect more appers at faster interface speed and the performance ratio often becomes grater than ten. This result is clearly explaining how fast is multiple block write (W:16K, 32 sectors) than single block write (W:100, 1 sector), and also larger card tends to be slow at single block write. Number of write transactions also affects life time of the flash memory media. When compared at same amount of write data, the single sector write in Figure 6 above wears flash memory media 16 times more than multiple sector write in Figure 6 below. Single sector write is pretty pain for the flash memory media.
-Therefore the application program should write the data in large block as possible. The ideal write chunk size and alighment is size of sector, and size of cluster is the best. Of course all layers between the application and the storage device must have consideration on multiple sector write, however most of open-source memory card drivers lack it. Do not split a multiple sector write request into single sector write transactions or the write throughput gets poor. Note that FatFs module and its sample disk drivers supprt multiple sector read/write operation.
-When remove a file with f_unlink function, the data clusters occupied by the file are marked 'free' on the FAT. But the data sectors containing the file data are not that applied any process, so that the file data left occupies a part of the flash memory array as 'live block'. If the file data can be erased on removing the file, those data blocks will be turned into the free block pool. This may skip internal block erase operation to the data block on next write operation. As the result the write performance might be improved. FatFs can manage this function by setting FF_USE_TRIM to 1. Note that because this effect is from an expectation of internal process of the storage device, it is not that always effective. Most applications will not need this function. Also f_unlink function can take a time when remove a large file.
-If a write operation to the FAT volume is interrupted due to an accidental failure, such as sudden blackout, wrong media removal and unrecoverable disk error, the FAT structure on the volume can be broken. Following images shows the critical section of the FatFs module.
-
-
-An interruption in the red section can cause a cross link; as a result, the object being changed can be lost. If an interruption in the yellow section is occured, there is one or more possibility listed below.
-Each case does not affect any file not opened in write mode. To minimize risk of data loss, the critical section can be minimized by minimizing the time that file is opened in write mode or using f_sync function as shown in Figure 5.
-These are examples of extended use of FatFs APIs. New item will be added when useful code example is found.
-FatFs has being developped as a personal project of the author, ChaN. It is free from the code anyone else wrote at current release. Following code block shows a copy of the FatFs license document that included in the source files.
--/*----------------------------------------------------------------------------/ -/ FatFs - Generic FAT Filesystem Module Rx.xx / -/-----------------------------------------------------------------------------/ -/ -/ Copyright (C) 20xx, ChaN, all right reserved. -/ -/ FatFs module is an open source software. Redistribution and use of FatFs in -/ source and binary forms, with or without modification, are permitted provided -/ that the following condition is met: -/ -/ 1. Redistributions of source code must retain the above copyright notice, -/ this condition and the following disclaimer. -/ -/ This software is provided by the copyright holder and contributors "AS IS" -/ and any warranties related to this software are DISCLAIMED. -/ The copyright owner or contributors be NOT LIABLE for any damages caused -/ by use of this software. -/----------------------------------------------------------------------------*/ --
Therefore FatFs license is one of the BSD-style licenses but there is a significant feature. FatFs is mainly intended for embedded systems. In order to extend the usability for commercial products, the redistributions of FatFs in binary form, such as embedded code, binary library and any forms without source code, does not need to include about FatFs in the documentations. This is equivalent to the 1-clause BSD license. Of course FatFs is compatible with the most of open source software licenses includes GNU GPL. When you redistribute the FatFs source code with any changes or create a fork, the license can also be changed to GNU GPL, BSD-style license or any open source software license that compatible with FatFs license.
-The f_chdir function changes the current directory of the logical drive.
--FRESULT f_chdir ( - const TCHAR* path /* [IN] Path name */ -); --
-FR_OK, -FR_DISK_ERR, -FR_INT_ERR, -FR_NOT_READY, -FR_NO_PATH, -FR_INVALID_NAME, -FR_INVALID_DRIVE, -FR_NOT_ENABLED, -FR_NO_FILESYSTEM, -FR_TIMEOUT, -FR_NOT_ENOUGH_CORE -
-The f_chdir function changes the current directory of the logical drive. Also the current drive will be changed when in Unix style drive prefix, FF_STR_VOLUME_ID == 2. The current directory of each logical drive is initialized to the root directory on mount.
-Note that the current directory is retained in the each file system object and the current drive is retained in a static variable, so that it also affects other tasks that use the file functions.
-Available when FF_FS_RPATH >= 1.
-- /* Change current direcoty of the current drive ("dir1" under root directory) */ - f_chdir("/dir1"); - - /* Change current direcoty of current drive (parent directory of drive 2) */ - f_chdir("2:.."); - - /* Change current direcoty of the drive "sdcard" (at DOS/Windows style volume ID) */ - f_chdir("sdcard:/dir1"); - - /* Change current direcoty of the drive "flash" and set it as current drive (at Unix style volume ID) */ - f_chdir("/flash/dir1"); --
The f_chdrive function changes the current drive.
--FRESULT f_chdrive ( - const TCHAR* path /* [IN] Logical drive number */ -); --
-FR_OK, -FR_INVALID_DRIVE -
-The f_chdrive function changes only the current drive. The initial value of the current drive number is 0. In Unix style drive prefix configuration, this function will not be needed because f_chdir function changes also the current drive. Note that the current drive is retained in a static variable, so that it also affects other tasks that using the file functions.
-Available when FF_FS_RPATH >= 1.
-
- f_chdrive("2:"); /* Set drive 2 as current drive */
-
- f_chdrive(""); /* No effect (set current drive as current drive) */
-
-The f_chmod function changes the attribute of a file or sub-directory.
--FRESULT f_chmod ( - const TCHAR* path, /* [IN] Object name */ - BYTE attr, /* [IN] Attribute flags */ - BYTE mask /* [IN] Attribute masks */ -); --
| Attribute | Description |
|---|---|
| AM_RDO | Read only |
| AM_ARC | Archive |
| AM_SYS | System |
| AM_HID | Hidden |
-FR_OK, -FR_DISK_ERR, -FR_INT_ERR, -FR_NOT_READY, -FR_NO_FILE, -FR_NO_PATH, -FR_INVALID_NAME, -FR_WRITE_PROTECTED, -FR_INVALID_DRIVE, -FR_NOT_ENABLED, -FR_NO_FILESYSTEM, -FR_TIMEOUT, -FR_NOT_ENOUGH_CORE -
-The f_chmod function changes the attribute of a file or sub-directory.
-Available when FF_FS_READONLY == 0 and FF_USE_CHMOD == 1.
-
- /* Set Read-only, clear Archive and others are left unchanged. */
- f_chmod("file.txt", AM_RDO, AM_RDO | AM_ARC);
-
-The f_close function closes an open file.
--FRESULT f_close ( - FIL* fp /* [IN] Pointer to the file object */ -); --
-FR_OK, -FR_DISK_ERR, -FR_INT_ERR, -FR_INVALID_OBJECT, -FR_TIMEOUT -
-The f_close function closes an open file object. If the file has been changed, the cached information of the file is written back to the volume. After the function succeeded, the file object is no longer valid and it can be discarded.
-Note that if the file object is in read-only mode and FF_FS_LOCK is not enabled, the file object can also be discarded without this procedure. However this is not recommended for future compatibility.
-Always available.
-The f_closedir function closes an open directory.
--FRESULT f_closedir ( - DIR* dp /* [IN] Pointer to the directory object */ -); --
-FR_OK, -FR_INT_ERR, -FR_INVALID_OBJECT, -FR_TIMEOUT -
-The f_closedir function closes an open directory object. After the function succeeded, the directory object is no longer valid and it can be discarded.
-Note that the directory object can also be discarded without this procedure when option FF_FS_LOCK is not enabled. However this is not recommended for future compatibility.
-Available when FF_FS_MINIMIZE <= 1.
-There are many options to configure the features of FatFs for various requirements of each project. The configuration options are defined in ffconf.h.
-Read/Write (0) or Read-only (1). Read-only configuration removes writing API functions, f_write, f_sync, f_unlink, f_mkdir, f_chmod, f_rename, f_truncate, f_getfree and optional writing functions as well.
- -This option defines minimization level to remove some basic API functions as follows:
-| Value | Description |
|---|---|
| 0 | All basic API functions are available. |
| 1 | f_stat, f_getfree, f_unlink, f_mkdir, f_chmod, f_utime, f_truncate and f_rename function are removed. |
| 2 | f_opendir, f_readdir and f_closedir function are removed in addition to 1. |
| 3 | f_lseek function is removed in addition to 2. |
Disable (0) or Enable (1) filtered directory read functions, f_findfirst and f_findnext. Also FF_FS_MINIMIZE needs to be 0 or 1.
- -Disable (0) or Enable (1) f_mkfs function.
- -Disable (0) or Enable (1) fast seek function to enable accelerated mode for f_lseek, f_read and f_write function. For more information, read here.
- -Disable (0) or Enable (1) f_expand function.
- -Disable (0) or Enable (1) metadata control functions, f_chmod and f_utime. Also FF_FS_READONLY needs to be 0.
- -Disable (0) or Enable (1) API functions for volume label, f_getlabel and f_setlabel.
- -Disable (0) or Enable (1) f_forward function.
- -This option switches string functions, f_gets, f_putc, f_puts and f_printf. These functions are equivalents of regular string stream I/O functions in POSIX. If sprintf is available and code conversion is not needed, f_write with sprintf will be efficient in code size and performance rather than f_printf. When enable this feature, stdarg.h is included in ff.c.
-| Value | Description |
|---|---|
| 0 | Disable string functions. |
| 1 | Enable string functions without LF-CRLF conversion. |
| 2 | Enable string functions with LF-CRLF conversion. |
This option switches support for long long integer argument in f_printf.
-Disable (0) or Enable (1). When enable this feature, C standard needs to be C99 or later.
- -This option switches support for floating point argument in f_printf. When enable this feature, C standard needs to be C99 or later and math.h is included in ff.c.
-| Value | Description |
|---|---|
| 0 | Disable floating point argument. |
| 1 | Enable floating point argument in type 'f', 'e' and 'E'. |
| 2 | Enable it with decimal separator ',' instead of '.'. |
When character encoding on the API is Unicode (FF_LFN_UNICODE >= 1), string I/O functions enabled by FF_USE_STRFUNC convert the character encoding in it. This option defines the assumption of character encoding on the file to be read/written via those functions. When LFN is not enabled or FF_LFN_UNICODE == 0, the string functions work without any code conversion and this option has no effect.
-| Value | Character encoding on the file |
|---|---|
| 0 | ANSI/OEM in current code page |
| 1 | Unicode in UTF-16LE |
| 2 | Unicode in UTF-16BE |
| 3 | Unicode in UTF-8 |
This option specifies the OEM code page used on the target system. Incorrect setting of the code page can cause a file open failure. If any non-ASCII character is not used for the path name or FF_LFN_UNICODE != 0, there is no difference between any code page settings. Set it 437 anyway.
-| Value | Code page |
|---|---|
| 0 | Includes all code pages below and set by f_setcp() |
| 437 | U.S. |
| 720 | Arabic |
| 737 | Greek |
| 771 | KBL |
| 775 | Baltic |
| 850 | Latin 1 |
| 852 | Latin 2 |
| 855 | Cyrillic |
| 857 | Turkish |
| 860 | Portuguese |
| 861 | Icelandic |
| 862 | Hebrew |
| 863 | Canadian French |
| 864 | Arabic |
| 865 | Nordic |
| 866 | Russian |
| 869 | Greek 2 |
| 932 | Japanese (DBCS) |
| 936 | Simplified Chinese (DBCS) |
| 949 | Korean (DBCS) |
| 950 | Traditional Chinese (DBCS) |
This option switches the support for long file name (LFN). When enable the LFN, Unicode support module ffunicode.c need to be added to the project. When use stack for the working buffer, take care on stack overflow. When use heap memory for the working buffer, memory management functions (ff_memalloc and ff_memfree) need to be added to the project.
-| Value | Description |
|---|---|
| 0 | Disable LFN. Path name in only 8.3 format can be used. |
| 1 | Enable LFN with static working buffer on the BSS. Always NOT thread-safe. |
| 2 | Enable LFN with dynamic working buffer on the STACK. |
| 3 | Enable LFN with dynamic working buffer on the HEAP. |
LFN function requiers certain internal working buffer for the file name. This option defines size of the buffer and the value can be in range of 12 to 255 characters (actually in UTF-16 code units) of the LFN. The buffer occupies (FF_MAX_LFN + 1) * 2 bytes and additional (FF_MAX_LFN + 44) / 15 * 32 bytes when exFAT is enabled. It is recommended to be set 255 to fully support the LFN specification. This option has no effect when LFN is not enabled.
- -This option switches character encoding for the file name on the API. FatFs supports the code point up to U+10FFFF. This option also affects behavior of string I/O functions (see FF_STRF_ENCODE).
-| Value | Character Encoding | TCHAR |
|---|---|---|
| 0 | ANSI/OEM in current CP | char |
| 1 | Unicode in UTF-16 | WCHAR |
| 2 | Unicode in UTF-8 | char |
| 3 | Unicode in UTF-32 | DWORD |
When Unicode is selected, FF_CODE_PAGE has actually no meaning except for compatibility with legacy systems, such as MS-DOS and any system without support for LFN.
-When LFN is not enabled, this option has no effect and FatFs works in ANSI/OEM code on the API. For more information, read here.
- -This set of options defines size of file name members, fname[] and altname[], in the FILINFO structure which is used to read out the directory items. These values should be suffcient for the file names to read. The maximum possible length of read file name depends on the character encoding scheme on the API as follows:
-| Encoding | LFN length | SFN length |
|---|---|---|
| ANSI/OEM in SBCS | 255 items | 12 items |
| ANSI/OEM in DBCS | 510 items | 12 items |
| Unicode in UTF-16/32 | 255 items | 12 items |
| Unicode in UTF-8 | 765 items | 34 items |
If the size of name member is insufficient for the LFN, the item is treated as without LFN. When LFN is not enabled, these options have no effect.
- -This option configures relative path function. For more information, read here.
-| Value | Description |
|---|---|
| 0 | Disable relative path and remove related functions. |
| 1 | Enable relative path. f_chdir and f_chdrive function is available. |
| 2 | f_getcwd function is available in addition to 1 |
This option configures number of volumes (logical drives up to 10) to be used.
- -This option switches the support for string volume ID. When arbitrary string for the volume ID is enabled for the drive prefix, also pre-defined strings by FF_VOLUME_STRS or user defined strings can be used as drive prefix in the path name. Numeric drive number is always valid regardless of this option, and also either format of drive prefix can be enabled by this option.
-| Value | Description | Example |
|---|---|---|
| 0 | Only DOS/Windows style drive prefix in numeric ID can be used. | 1:/filename |
| 1 | Also DOS/Windows style drive prefix in string ID can be used. | flash:/filename |
| 2 | Also Unix style drive prefix in string ID can be used. | /flash/filename |
This option defines the volume ID strings for each logical drives. Number of items must not be less than FF_VOLUMES. Valid characters for the volume ID string are A-Z, a-z and 0-9, however, they are compared in case-insensitive. If FF_STR_VOLUME_ID == 0, this option has no effect. If FF_STR_VOLUME_ID >= 1 and this option is not defined, a user defined volume string table needs to be defined as shown below. The table should not be modified on the fly.
-
-/* User defined volume ID strings for 0: to 3: */
-const char* VolumeStr[FF_VOLUMES] = {"ram","flash","sd","usb"};
-
-
-Disable (0) or Enable (1). This option switches multi-partition function. By default (0), each logical drive number is bound to the same physical drive number and only a volume in the physical drive is mounted. When enabled, each logical drive is bound to the partition on the physical drive listed in the user defined partition resolution table VolToPart[]. Also f_fdisk funciton will be available. For more information, read here.
- -This set of options defines the extent of sector size used for the low level disk I/O interface, disk_read and disk_write function. Valid values are 512, 1024, 2048 and 4096. FF_MIN_SS defines minimum sector size and FF_MAX_SS defines the maximum sector size. Always set both 512 for memory card and harddisk. But a larger value may be required for on-board flash memory and some type of optical media. When FF_MAX_SS > FF_MIN_SS, support of variable sector size is enabled and GET_SECTOR_SIZE command needs to be implemented to the disk_ioctl function.
- -This option switches media access interface to 64-bit LBA and enables GUID Partition Table (GPT) for partition management, Enabled (1) or Disabled (0). exFAT filesystem needs to be enabled to enable this feature.
- -This option specifies the threshold of determination of partitioning format when create patitions on the drive in f_mkfs and f_fdisk function. When number of available sectors is equal or larger than this value, the drive will be partitioned in GPT. This option has no effect when FF_LBA64 == 0.
- -Disable (0) or Enable (1). This option switches ATA-TRIM function. To enable Trim function, also CTRL_TRIM command should be implemented to the disk_ioctl function.
- -Normal (0) or Tiny (1). The tiny configuration reduces size of the FIL structure, file object, FF_MAX_SS bytes each. Instead of private sector buffer eliminated from the file object, common sector buffer in the FATFS structure, filesystem object, is used for the file data transfer.
- -This option switches support for exFAT filesystem in addition to the FAT/FAT32 filesystem, Enabled (1) or Disabled (0). To enable exFAT, also LFN must be enabled and configureing FF_LFN_UNICODE >= 1 and FF_MAX_LFN == 255 is recommended for full-featured exFAT function. Note that enabling exFAT discards ANSI C (C89) compatibility and wants C99 because of need for 64-bit integer type.
- -Use RTC (0) or Do not use RTC (1). This option controls timestamp featuer. If the system does not have an RTC or valid timestamp is not needed, set FF_FS_NORTC to 1 to disable the timestamp function. Every objects modified by FatFs will have a constant timestamp defined by FF_NORTC_MON, FF_NORTC_MDAY and FF_NORTC_YEAR. To use the timestamp featuer, set FF_FS_NORTC == 0 and add get_fattime function to the project to get current time form the RTC. This option has no effect in read-only configuration.
- -This set of options defines the time to be used in no RTC systems. This option has no effect in read-only configuration or FF_FS_NORTC == 0.
- -0 to 3. If you need to know correct free space on the FAT32 volume, set bit 0 of this option, and f_getfree function at first time after the volume mounted will force a full FAT scan. Bit 1 controls the use of last allocated cluster number for new allocation.
-| Value | Description |
|---|---|
| bit0=0 | Use free cluster count in the FSINFO if available. |
| bit0=1 | Do not trust free cluster count in the FSINFO. |
| bit1=0 | Use last allocated cluster number in the FSINFO to find a free cluster if available. |
| bit1=1 | Do not trust last allocated cluster number in the FSINFO. |
This option switches file lock feature to control duplicated file open and illegal operations to the open objects. Note that this feature is independent of re-entrancy. This option must be 0 in read-only configuration.
-| Value | Description |
|---|---|
| 0 | Disable file lock feature. To avoid to collapse files due to wrong file operations, application program needs to avoid illegal open, remove and rename to the open objects. |
| >0 | Enable file lock feature. The value defines how many files/sub-directories can be opened simultaneously under the file lock feature. Illigal operations to the open object will be rejected with FR_LOCKED. |
Disable (0) or Enable (1). This option switches the re-entrancy (thread safe) of the FatFs module itself. Note that file/directory access to the different volume is always re-entrant and it can work simultaneously regardless of this option, however, volume management functions, f_mount, f_mkfs and f_fdisk, are always not re-entrant. Only file/directory access to the same volume, in other words, exclusive use of each filesystem object, is under control in this feature. To enable this feature, also user provided synchronization handlers, ff_mutex_take, ff_mutex_give, ff_mutex_create and ff_mutex_delete, need to be added to the project. Sample code is available in ffsystem.c.
- -Number of O/S time ticks to abort the file function with FR_TIMEOUT when the wait time exceeds this period. This option has no effect when FF_FS_REENTRANT == 0.
- -The disk_initialize function is called to initializes the storage device.
--DSTATUS disk_initialize ( - BYTE pdrv /* [IN] Physical drive number */ -); --
This function returns the current drive status flags as the result. For details of the drive status, refer to the disk_status function.
-This function initializes the storage device and put it ready to generic read/write. When the function succeeded, STA_NOINIT flag in the return value is cleared.
-Remarks: This function needs to be under control of FatFs module. Application program MUST NOT call this function while FatFs is in use, or FAT structure on the volume can be broken. To re-initialize the filesystem, use f_mount function instead.
-The disk_ioctl function is called to control device specific features and miscellaneous functions other than generic read/write.
--DRESULT disk_ioctl ( - BYTE pdrv, /* [IN] Drive number */ - BYTE cmd, /* [IN] Control command code */ - void* buff /* [I/O] Parameter and data buffer */ -); --
The FatFs module requires only five device independent commands described below.
-| Command | Description |
|---|---|
| CTRL_SYNC | Makes sure that the device has finished pending write process. If the disk I/O layer or storage device has a write-back cache, the dirty cache data must be committed to the medium immediately. Nothing to do for this command if each write operation to the medium is completed in the disk_write function. |
| GET_SECTOR_COUNT | Retrieves number of available sectors, the largest allowable LBA + 1, on the drive into the LBA_t variable that pointed by buff. This command is used by f_mkfs and f_fdisk function to determine the size of volume/partition to be created. |
| GET_SECTOR_SIZE | Retrieves sector size, minimum data unit for generic read/write, into the WORD variable that pointed by buff. Valid sector sizes are 512, 1024, 2048 and 4096. This command is required only if FF_MAX_SS > FF_MIN_SS. When FF_MAX_SS == FF_MIN_SS, this command will never be used and the disk_read and disk_write function must work in FF_MAX_SS bytes/sector. |
| GET_BLOCK_SIZE | Retrieves erase block size in unit of sector of the flash memory media into the DWORD variable that pointed by buff. The allowable value is 1 to 32768 in power of 2. Return 1 if it is unknown or in non flash memory media. This command is used by f_mkfs function with block size not specified and it attempts to align the data area on the suggested block boundary. Note that FatFs does not have FTL (flash translation layer), so that either disk I/O layter or storage device must have an FTL in it. |
| CTRL_TRIM | Informs the disk I/O layter or the storage device that the data on the block of sectors is no longer needed and it can be erased. The sector block is specified in an LBA_t array {<Start LBA>, <End LBA>} that pointed by buff. This is an identical command to Trim of ATA device. Nothing to do for this command if this funcion is not supported or not a flash memory device. FatFs does not check the result code and the file function is not affected even if the sector block was not erased well. This command is called on remove a cluster chain and in the f_mkfs function. It is required when FF_USE_TRIM == 1. |
FatFs will never use any device dependent command nor user defined command. Following table shows an example of non-standard commands which may be useful for some applications.
-| Command | Description |
|---|---|
| CTRL_FORMAT | Creates a physical format on the media. If buff is not null, it is pointer to the call-back function for progress notification. |
| CTRL_POWER_IDLE | Puts the device idle state. STA_NOINIT in the current status flags may not be set if the device goes active state by generic read/write function. |
| CTRL_POWER_OFF | Puts the device off state. Shut-down the power to the device and deinitialize the device interface if needed. STA_NOINIT in the current status flags must be set. The device goes active state by disk_initialize function. |
| CTRL_LOCK | Locks media eject mechanism. |
| CTRL_UNLOCK | Unlocks media eject mechanism. |
| CTRL_EJECT | Ejects media cartridge. STA_NOINIT and STA_NODISK in status flag are set after the function succeeds. |
| CTRL_GET_SMART | Reads SMART information. |
| MMC_GET_TYPE | Gets card type. The type flags, bit0:MMCv3, bit1:SDv1, bit2:SDv2+ and bit3:LBA, is stored to a BYTE variable pointed by buff. (MMC/SDC specific command) |
| MMC_GET_CSD | Reads CSD register and sets it into a 16-byte buffer pointed by buff. (MMC/SDC specific command) |
| MMC_GET_CID | Reads CID register and sets it into a 16-byte buffer pointed by buff. (MMC/SDC specific command) |
| MMC_GET_OCR | Reads OCR register and sets it into a 4-byte buffer pointed by buff. (MMC/SDC specific command) |
| MMC_GET_SDSTAT | Reads SDSTATUS register and sets it into a 64-byte buffer pointed by buff. (SDC specific command) |
| ATA_GET_REV | Reads the revision string and sets it into a 16-byte buffer pointed by buff. (ATA/CFC specific command) |
| ATA_GET_MODEL | Reads the model string and sets it into a 40-byte buffer pointed by buff. (ATA/CFC specific command) |
| ATA_GET_SN | Reads the serial number string and sets it into a 20-byte buffer pointed by buff. (ATA/CFC specific command) |
| ISDIO_READ | Reads a block of iSDIO registers specified by command structure pointed by buff. (FlashAir specific command) |
| ISDIO_WRITE | Writes a block of data to iSDIO registers specified by command structure pointed by buff. (FlashAir specific command) |
| ISDIO_MRITE | Changes bits in an iSDIO register specified by command structure pointed by buff. (FlashAir specific command) |
The disk_ioctl function is not needed when FF_FS_READONLY == 1 and FF_MAX_SS == FF_MIN_SS.
-The disk_read function is called to read data from the storage device.
--DRESULT disk_read ( - BYTE pdrv, /* [IN] Physical drive number */ - BYTE* buff, /* [OUT] Pointer to the read data buffer */ - LBA_t sector, /* [IN] Start sector number */ - UINT count /* [IN] Number of sectros to read */ -); --
Read/write operation to the generic storage devices, such as memory card, hadddisk and optical disk, is done in unit of block of data bytes called sector. FatFs supports the sector size in range of 512 to 4096 bytes. When FatFs is configured for fixed sector size (FF_MIN_SS == FF_MAX_SS, this is the most case), the generic read/write function must work at this sector size only. When FatFs is configured for variable sector size (FF_MIN_SS < FF_MAX_SS), the sector size of medium is inquired with disk_ioctl function after disk_initialize function succeeds.
-There are some considerations about the memory addres passed via buff. It is not that always aligned with the word boundary, because the argument is defined as BYTE*. The unaligned transfer request can occure at direct transfer. If the bus architecture, especially DMA controller, does not allow unaligned memory access, it should be solved in this function. If it is the case, there are some workarounds described below to avoid this issue.
-Also the memory area may be out of reach in DMA. This is the case if it is located on the tightly coupled memory which is usually used for stack. Use double buffered transfer, or avoid to define file I/O buffer, FATFS and FIL structure as local variables where on the stack.
-Generally, a multiple sector read request must not be split into single sector transactions to the storage device, or read throughput gets worse.
-The disk_status function is called to inquire the current drive status.
--DSTATUS disk_status ( - BYTE pdrv /* [IN] Physical drive number */ -); --
The current drive status is returned in combination of status flags described below. FatFs refers only STA_NOINIT and STA_PROTECT.
-The disk_write function is called to write data to the storage device.
--DRESULT disk_write ( - BYTE pdrv, /* [IN] Physical drive number */ - const BYTE* buff, /* [IN] Pointer to the data to be written */ - LBA_t sector, /* [IN] Sector number to write from */ - UINT count /* [IN] Number of sectors to write */ -); --
The specified memory address is not that always aligned to word boundary because the argument is defined as BYTE*. For more information, refer to the description of disk_read function.
-Generally, a multiple sector write request (count > 1) must not be split into single sector transactions to the storage device, or the file write throughput will be drastically decreased.
-FatFs expects delayed write function of the disk control layer. The write operation to the media does not need to be completed when return from this function by what write operation is in progress or data is only stored into the write-back cache. But write data on the buff is invalid after return from this function. The write completion request is done by CTRL_SYNC command of disk_ioctl function. Therefore, if a delayed write function is implemented, the write throughput of the filesystem will be improved.
-Remarks: Application program MUST NOT call this function, or FAT structure on the volume can be collapsed.
-This function is not needed when FF_FS_READONLY == 1.
-The f_eof function tests for end-of-file on a file.
--int f_eof ( - FIL* fp /* [IN] File object */ -); --
The f_eof function returns a non-zero value if the read/write pointer has reached end of the file; otherwise it returns a zero.
-In this revision, this function is implemented as a macro. It does not have any validation and mutual exclusion.
-
-#define f_eof(fp) ((int)((fp)->fptr == (fp)->fsize))
-
-Always available.
-The f_error tests for an error on a file.
--int f_error ( - FIL* fp /* [IN] File object */ -); --
Returns a non-zero value if a hard error has occured; otherwise it returns a zero.
-In this revision, this function is implemented as a macro. It does not have any validation and mutual exclusion.
-
-#define f_error(fp) ((fp)->err)
-
-Always available.
-The f_expand function prepares or allocates a contiguous data area to the file.
- --FRESULT f_expand ( - FIL* fp, /* [IN] File object */ - FSIZE_t fsz, /* [IN] File size expanded to */ - BYTE opt /* [IN] Allocation mode */ -); --
-FR_OK, -FR_DISK_ERR, -FR_INT_ERR, -FR_INVALID_OBJECT, -FR_DENIED, -FR_TIMEOUT -
-The f_expand function prepares or allocates a contiguous data area to the file. When opt is 1, the data area is allocated to the file in this function. Unlike expansion of file size by f_lseek function, the file must be truncated prior to use this function and read/write pointer of the file stays at offset 0 after the function call. The file content allocated with this function is undefined, because no data is written to the file in this process. The function can fail with FR_DENIED due to some reasons below.
-When opt is 0, the function finds a contiguous data area and set it as suggested point for next allocation. The subsequent cluster allocation begins at top of the contiguous area found by this function. Thus the file allocation is guaranteed be contiguous and without allocation delay until the file size reaches this size unless any other changes to the volume is performed.
-The contiguous file has an advantage for time-critical read/write operations. It eliminates some overheads in the filesystem and the storage device caused by random access for fragmented file.
-Also the contiguous file can be easily accessed directly via low-level disk functions. However, this is not recommended in consideration of portability and future compatibility. If the file has not been confirmed be contiguous, use this function to examine if the file is contiguous or not.
-Available when FF_USE_EXPAND == 1 and FF_FS_READONLY == 0.
-- /* Creating a contiguous file */ - - /* Create a new file */ - res = f_open(fp = malloc(sizeof (FIL)), "file.dat", FA_WRITE|FA_CREATE_ALWAYS); - if (res) { /* Check if the file has been opened */ - free(fp); - die("Failed to open the file."); - } - - /* Alloacte a 100 MiB of contiguous area to the file */ - res = f_expand(fp, 104857600, 1); - if (res) { /* Check if the file has been expanded */ - f_close(fp); - free(fp); - die("Failed to allocate contiguous area."); - } - - /* Now you have a contiguous file accessible with fp */ - --
- /* Accessing the contiguous file via low-level disk functions */ - - /* Get physical location of the file data */ - drv = fp->obj.fs->pdrv; - lba = fp->obj.fs->database + fp->obj.fs->csize * (fp->obj.sclust - 2); - - /* Write 2048 sectors from top of the file at a time */ - res = disk_write(drv, buffer, lba, 2048); - --
The get_fattime function is called to get the current time.
--DWORD get_fattime (void); --
Currnet local time shall be returned as bit-fields packed into a DWORD value. The bit fields are as follows:
-The get_fattime function shall return any valid time even if the system does not support a real time clock. If a zero is returned, the file will not have a valid timestamp.
-This function is not needed when FF_FS_READONLY == 1 or FF_FS_NORTC == 1.
-
-DWORD get_fattime (void)
-{
- time_t t;
- struct tm *stm;
-
-
- t = time(0);
- stm = localtime(&t);
-
- return (DWORD)(stm->tm_year - 80) << 25 |
- (DWORD)(stm->tm_mon + 1) << 21 |
- (DWORD)stm->tm_mday << 16 |
- (DWORD)stm->tm_hour << 11 |
- (DWORD)stm->tm_min << 5 |
- (DWORD)stm->tm_sec >> 1;
-}
-
-The f_fdisk fucntion divides a physical drive.
--FRESULT f_fdisk ( - BYTE pdrv, /* [IN] Physical drive number */ - const LBA_t ptbl[], /* [IN] Partition map table */ - void* work /* [IN] Work area */ -); --
-FR_OK, -FR_DISK_ERR, -FR_NOT_READY, -FR_WRITE_PROTECTED, -FR_INVALID_PARAMETER, -FR_NOT_ENOUGH_CORE -
-The f_fdisk function creates partitions on the physical drive. The partitioning format can be in generic MBR or GPT. The partition map table specifies how to divide the physical drive. The first item specifies the size of the first partition and the partitions are located on the drive in order of from the first item. When the value of item is less than or equal to 100, it specifies the partition size in percentage of the entire drive space. When it is larger than 100, it specifies number of sectors. The partition map table is terminated by a zero, no space is remaining for next allocation or 4th partition is created in MBR format. If the specified size is larger than remaining space on the drive, the partition is truncated at end of the drive.
-By default, partitions are created in MBR format. It can create upto four primary partitions on a drive. GPT format is used to create the partitions when 64-bit LBA is enabled (FF_LBA64 = 1) and the drive size is equal to or larger than FF_MIN_GPT sectors. It can create over ten partitions on a drive.
-Available when FF_FS_READOLNY == 0, FF_USE_MKFS == 1 and FF_MULTI_PARTITION == 1.
-- /* Volume mapping table defined by user (required when FF_MULTI_PARTITION == 1) */ - - PARTITION VolToPart[FF_VOLUMES] = { - {0, 1}, /* "0:" ==> 1st partition in PD#0 */ - {0, 2}, /* "1:" ==> 2nd partition in PD#0 */ - {1, 0} /* "2:" ==> PD#1 as removable drive */ - }; --
- /* Initialize a brand-new disk drive mapped to physical drive 0 */ - - BYTE work[FF_MAX_SS]; /* Working buffer */ - LBA_t plist[] = {50, 50, 0}; /* Divide the drive into two partitions */ - /* {0x10000000, 100}; 256M sectors for 1st partition and left all for 2nd partition */ - /* {20, 20, 20, 0}; 20% for 3 partitions each and remaing space is left not allocated */ - - f_fdisk(0, plist, work); /* Divide physical drive 0 */ - - f_mkfs("0:", 0, work, sizeof work); /* Create FAT volume on the logical drive 0 */ - f_mkfs("1:", 0, work, sizeof work); /* Create FAT volume on the logical drive 1 */ - --
The format of path name on the FatFs module is similer to the filename specs of DOS/Windos as follows:
-[drive#:][/]directory/file-
The FatFs module supports long file name (LFN) and 8.3 format file name (SFN). The LFN can be used when FF_USE_LFN >= 1. The sub-directories are separated with a \ or / as the same way as DOS/Windows API. Duplicated separator and terminating separator, such as "//animal///cat/", are ignored. Only a difference is that the heading drive prefix to specify the logical drive, an FAT volume, is in a digit (0-9) + a colon, while it is in an alphabet (A-Z) + a colon in DOS/Windows. The logical drive number is the identifier to specify the volume to be accessed. When drive prefix is omitted, the logical drive number is assumed as default drive.
-Control characters (\0 to \x1F) are recognized as end of the path name. In LFN configuration, leading or embedded white spaces in the file name are valid as part of the file name, but the treminating white space and dot of the file name are ignored and truncated. In non-LFN configuration, white space is recognized as end of the path name.
-In default configuration (FF_FS_RPATH == 0), it does not have a concept of current directory like OS oriented filesystem. Every object on the volume is always specified in full path name followed from the root directory. Dot directory names (".", "..") are not allowed. Heading separator is ignored and it can be exist or omitted. The default drive is fixed to drive 0.
-When relative path feature is enabled (FF_FS_RPATH >= 1), specified path is followed from the root directory if a heading separator is exist. If not, it is followed from the current directory of the default drive. Dot directory name is also allowed for the path name. The current directory is set by f_chdir function and the default drive is the current drive set by f_chdrive function.
-| Path name | FF_FS_RPATH == 0 | FF_FS_RPATH >= 1 |
| file.txt | A file in the root directory of the drive 0 | A file in the current directory of the current drive |
| /file.txt | A file in the root directory of the drive 0 | A file in the root directory of the current drive |
| The root directory of the drive 0 | The current directory of the current drive | |
| / | The root directory of the drive 0 | The root directory of the current drive |
| 2: | The root directory of the drive 2 | The current directory of the drive 2 |
| 2:/ | The root directory of the drive 2 | The root directory of the drive 2 |
| 2:file.txt | A file in the root directory of the drive 2 | A file in the current directory of the drive 2 |
| ../file.txt | Invalid name | A file in the parent directory |
| . | Invalid name | This directory |
| .. | Invalid name | Parent directory of the current directory (*) |
| dir1/.. | Invalid name | The current directory |
| /.. | Invalid name | The root directory (sticks the top level) |
Also the drive prefix can be in pre-defined arbitrary string. When the option FF_STR_VOLUME_ID == 1, also arbitrary string volume ID can be used as drive prefix. e.g. "flash:file1.txt", "ram:temp.dat" or "sd:". If the srting does not match any volume ID, the function fails with FR_INVALID_DRIVE.
-When FF_STR_VOLUME_ID == 2, Unix style drive prefix can be used. e.g. "/flash/file1.txt", "/ram/temp.dat" or "/sd". If a heading separator is exist, it is treated as start of drive prefix and in absolute path. Any form as "root directory in current drive" and "current directory in specified drive" cannot be used. Double dot name cannot traverse the drives such as "/flash/../ram/foo.dat".
-Remark: In this revision, double dot name ".." cannot follow the parent directory on the exFAT volume. It will work as "." and stay there.
-In the generic FAT filesystems, the legal characters for object name (file/directory name) are, 0-9 A-Z ! # $ % & ' ( ) - @ ^ _ ` { } ~ in ASCII and extended characters \x80 to \xFF. In the FAT filesystems with LFN extention, also + , ; = [ ], white space and extended characters U+000080 to U+10FFFF are legal for the object name. White spaces and dots can be placed anywhere in the path name except end of the name. Trailing white spaces and dots are ignored.
-FAT filesystem is case-insensitive to the object names on the volume. Object name on the FAT volume is compared in case-insensitive. For instance, these three names, file.txt, File.Txt and FILE.TXT, are identical on the FAT filesystem. This is applied to extended charactres as well. When an object is created on the FAT volume, up converted name is recorded to the SFN entry, and the raw name is recorded to the LFN entry when LFN extension is exist.
-As for the MS-DOS and PC DOS for CJK (DOS/DBCS), extended characters ware recorded to the SFN entry without up-case conversion and compared in case-sensitive. This causes a problem on compatibility with Windows system when the object with extended characters is created on the volume by DOS/DBCS system; therfore the object names with DBCS extended characters should not be used on the FAT volume shared by those systems. FatFs works with case-sensitive to the extended characters in only non-LFN with DBCS configuration (DOS/DBCS specs). However, FatFs works with case-insensitive to the extended character (WindowsNT specs) in LFN configuration.
-The path names are input/output in either ANSI/OEM code or Unicode depends on the configuration options. The type of arguments which specifies the path names is defined as TCHAR. It is an alias of char by default and the code set used for the path name string is ANSI/OEM specifid by FF_CODE_PAGE. When FF_LFN_UNICODE is set to 1 or larger, the type of the TCHAR is switched to proper type to support the Unicode string. When Unicode API is specified by this option, the full-featured LFN specification is supported and the Unicode specific characters, such as ✝☪✡☸☭ and any character not in BMP, can also be used for the path name. It also affects data types and encoding of the string I/O functions. To define literal strings, _T(s) and _TEXT(s) macro are available to specify the string in proper type. The code shown below is an example to define the literal strings.
-- f_open(fp, "filename.txt", FA_READ); /* ANSI/OEM string (char) */ - f_open(fp, L"filename.txt", FA_READ); /* UTF-16 string (WCHAR) */ - f_open(fp, u8"filename.txt", FA_READ); /* UTF-8 string (char) */ - f_open(fp, U"filename.txt", FA_READ); /* UTF-32 string (DWORD) */ - f_open(fp, _T("filename.txt"), FA_READ); /* Changed by configuration (TCHAR) */ --
By default, each logical drive is associated with the physical drive in same drive number. An FAT volume on the physical drive is serched in the volume mount process. It reads boot sectors and checks it if it is an FAT VBR in order of LBA 0 as SFD format, 1st partition, 2nd partition, 3rd partition, ..., as MBR or GPT format.
-When multiple partition feature is enabled, FF_MULTI_PARTITION = 1, each individual logical drive is associated with arbitrary partition or physical drive specified by volume management table, VolToPart[]. The table needs to be defined by user to resolve mappings of the logical drive numbers and the associated partitions or drives. Following code is an example of the volume management table.
-
-Example: "0:", "1:" and "2:" are associated with three partitions on the physical drive 0 (a non-removable drive)
- "3:" is associated with physical drive 1 (a removable drive)
-
-PARTITION VolToPart[FF_VOLUMES] = {
- {0, 1}, /* "0:" ==> 1st partition on the pd#0 */
- {0, 2}, /* "1:" ==> 2nd partition on the pd#0 */
- {0, 3}, /* "2:" ==> 3rd partition on the pd#0 */
- {1, 0} /* "3:" ==> pd#1 as removable drive (auto-search) */
-};
-
-
-
-
-There are some considerations when enable the multi-partition configuration.
-The f_findfirst function searches a directroy for an item.
--FRESULT f_findfirst ( - DIR* dp, /* [OUT] Poninter to the directory object */ - FILINFO* fno, /* [OUT] Pointer to the file information structure */ - const TCHAR* path, /* [IN] Pointer to the directory name to be opened */ - const TCHAR* pattern /* [IN] Pointer to the matching pattern string */ -); --
-FR_OK, -FR_DISK_ERR, -FR_INT_ERR, -FR_NOT_READY, -FR_NO_PATH, -FR_INVALID_NAME, -FR_INVALID_OBJECT, -FR_INVALID_DRIVE, -FR_NOT_ENABLED, -FR_NO_FILESYSTEM, -FR_TIMEOUT, -FR_NOT_ENOUGH_CORE, -FR_TOO_MANY_OPEN_FILES -
-After the directory specified by path could be opened, it starts to search the directory for items with the matching pattern specified by pattern. If the first item is found, the information about the item is stored into the file information structure fno. If not found, fno->fname[] has a null string.
-The matching pattern string can contain wildcards. For example:
-Since the matching algorithm uses recursion, number of wildcards in the matching pattern is limited to four to limit the stack usage. Any pattern with too many wildcards does not match any name. In LFN configuration, only fname[] is tested when FF_USE_FIND == 1 and also altname[] is tested when FF_USE_FIND == 2. There are some differences listed below between FatFs and standard systems in matching condition.
-This is a wrapper function of f_opendir and f_readdir function. Available when FF_USE_FIND >= 1 and FF_FS_MINIMIZE <= 1.
--/* Search a directory for objects and display it */ - -void find_image_file (void) -{ - FRESULT fr; /* Return value */ - DIR dj; /* Directory object */ - FILINFO fno; /* File information */ - - fr = f_findfirst(&dj, &fno, "", "????????.JPG"); /* Start to search for photo files */ - - while (fr == FR_OK && fno.fname[0]) { /* Repeat while an item is found */ - printf("%s\n", fno.fname); /* Print the object name */ - fr = f_findnext(&dj, &fno); /* Search for next item */ - } - - f_closedir(&dj); -} --
The f_findnext function searches for a next matched object
--FRESULT f_findnext ( - DIR* dp, /* [IN] Poninter to the directory object */ - FILINFO* fno /* [OUT] Pointer to the file information structure */ -); --
-FR_OK, -FR_DISK_ERR, -FR_INT_ERR, -FR_NOT_READY, -FR_INVALID_OBJECT, -FR_TIMEOUT, -FR_NOT_ENOUGH_CORE -
-It continues the search from a previous call to the f_findfirst or f_findnext function. If found, the information about the object is stored into the file information structure. If no item to be read, a null string will be returned into fno->fname[].
-This is a wrapper function of f_readdir function. Available when FF_USE_FIND == 1 and FF_FS_MINIMIZE <= 1.
-The f_forward function reads the file data and forward it to the data streaming device.
--FRESULT f_forward ( - FIL* fp, /* [IN] File object */ - UINT (*func)(const BYTE*,UINT), /* [IN] Data streaming function */ - UINT btf, /* [IN] Number of bytes to forward */ - UINT* bf /* [OUT] Number of bytes forwarded */ -); --
-FR_OK, -FR_DISK_ERR, -FR_INT_ERR, -FR_INVALID_OBJECT, -FR_DENIED, -FR_TIMEOUT -
-The f_forward function reads the data from the file and forward it to the outgoing stream. This function is suitable for small memory system, because it does not require any data buffer in the application module. The file pointer of the file object advances in number of bytes forwarded. In case of *bf is less than btf without error, it means the requested size of data could not be transferred due to end of file or stream goes busy during data transfer.
-Available when FF_USE_FORWARD == 1.
--/*------------------------------------------------------------------------*/ -/* Sample code of data transfer function to be called back from f_forward */ -/*------------------------------------------------------------------------*/ - -UINT out_stream ( /* Returns number of bytes sent or stream status */ - const BYTE *p, /* Pointer to the data block to be sent */ - UINT btf /* >0: Transfer call (Number of bytes to be sent). 0: Sense call */ -) -{ - UINT cnt = 0; - - - if (btf == 0) { /* Sense call */ - /* Return stream status (0: Busy, 1: Ready) */ - /* When once it returned ready to sense call, it must accept a byte at least */ - /* at subsequent transfer call, or f_forward will fail with FR_INT_ERR. */ - if (FIFO_READY) cnt = 1; - } - else { /* Transfer call */ - do { /* Repeat while there is any data to be sent and the stream is ready */ - FIFO_PORT = *p++; - cnt++; - } while (cnt < btf && FIFO_READY); - } - - return cnt; -} - - -/*------------------------------------------------------------------------*/ -/* Sample code using f_forward function */ -/*------------------------------------------------------------------------*/ - -FRESULT play_file ( - char *fn /* Pointer to the audio file name to be played */ -) -{ - FRESULT rc; - FIL fil; - UINT dmy; - - /* Open the audio file in read only mode */ - rc = f_open(&fil, fn, FA_READ); - if (rc) return rc; - - /* Repeat until the file pointer reaches end of the file */ - while (rc == FR_OK && !f_eof(&fil)) { - - /* some processes... */ - - /* Fill output stream periodicaly or on-demand */ - rc = f_forward(&fil, out_stream, 1000, &dmy); - } - - /* Close the file and return */ - f_close(&fil); - return rc; -} --
The f_getcwd function retrieves the current directory of the current drive.
--FRESULT f_getcwd ( - TCHAR* buff, /* [OUT] Buffer to return path name */ - UINT len /* [IN] The length of the buffer */ -); --
-FR_OK, -FR_DISK_ERR, -FR_INT_ERR, -FR_NOT_READY, -FR_NOT_ENABLED, -FR_NO_FILESYSTEM, -FR_TIMEOUT, -FR_NOT_ENOUGH_CORE -
-The f_getcwd function retrieves full path name of the current directory of the current drive. When FF_VOLUMES >= 2, a heading drive prefix is added to the path name. The style of drive prefix depends on FF_STR_VOLUME_ID.
-Note: In this revision, this function cannot retrieve the current directory path on the exFAT volume. It always returns the root directory path.
-Available when FF_FS_RPATH == 2.
-
- FRESULT fr;
- TCHAR str[SZ_STR];
-
- fr = f_getcwd(str, SZ_STR); /* Get current directory path */
-
-
-The f_getfree function gets number of the free clusters on the volume.
--FRESULT f_getfree ( - const TCHAR* path, /* [IN] Logical drive number */ - DWORD* nclst, /* [OUT] Number of free clusters */ - FATFS** fatfs /* [OUT] Corresponding filesystem object */ -); --
-FR_OK, -FR_DISK_ERR, -FR_INT_ERR, -FR_NOT_READY, -FR_INVALID_DRIVE, -FR_NOT_ENABLED, -FR_NO_FILESYSTEM, -FR_TIMEOUT -
-The f_getfree function gets number of free clusters on the volume. The member csize in the filesystem object indicates number of sectors per cluster, so that the free space in unit of sector can be calcurated with this information. In case of FSINFO structure on the FAT32 volume is not in sync, this function can return an incorrect free cluster count. To avoid this problem, FatFs can be forced full FAT scan by FF_FS_NOFSINFO option.
-Available when FF_FS_READONLY == 0 and FF_FS_MINIMIZE == 0.
-- FATFS *fs; - DWORD fre_clust, fre_sect, tot_sect; - - - /* Get volume information and free clusters of drive 1 */ - res = f_getfree("1:", &fre_clust, &fs); - if (res) die(res); - - /* Get total sectors and free sectors */ - tot_sect = (fs->n_fatent - 2) * fs->csize; - fre_sect = fre_clust * fs->csize; - - /* Print the free space (assuming 512 bytes/sector) */ - printf("%10lu KiB total drive space.\n%10lu KiB available.\n", tot_sect / 2, fre_sect / 2); --
The f_getlabel function returns volume label and volume serial number of a volume.
--FRESULT f_getlabel ( - const TCHAR* path, /* [IN] Drive number */ - TCHAR* label, /* [OUT] Volume label */ - DWORD* vsn /* [OUT] Volume serial number */ -); --
| Configuration | FF_FS_EXFAT == 0 | FF_FS_EXFAT == 1 |
| FF_USE_LFN == 0 | 12 items | - |
| FF_LFN_UNICODE == 0 | 12 items | 23 items |
| FF_LFN_UNICODE == 1,3 | 12 items | 12 items |
| FF_LFN_UNICODE == 2 | 34 items | 34 items |
-FR_OK, -FR_DISK_ERR, -FR_INT_ERR, -FR_NOT_READY, -FR_INVALID_DRIVE, -FR_NOT_ENABLED, -FR_NO_FILESYSTEM, -FR_TIMEOUT -
-Available when FF_USE_LABEL == 1.
-- char str[12]; - - /* Get volume label of the default drive */ - f_getlabel("", str, 0); - - /* Get volume label of the drive 2 */ - f_getlabel("2:", str, 0); --
The f_gets reads a string from the file.
--TCHAR* f_gets ( - TCHAR* buff, /* [OUT] Read buffer */ - int len, /* [IN] Size of the read buffer */ - FIL* fp /* [IN] File object */ -); --
When the function succeeded, buff will be returuned.
-The read operation continues until a '\n' is stored, reached end of the file or the buffer is filled with len - 1 characters. The read string is terminated with a '\0'. When no character to read or any error occured during read operation, it returns a null pointer. The status of EOF and error can be examined with f_eof and f_error function.
-When FatFs is configured to Unicode API (FF_LFN_UNICODE >= 1), data types on the srting fuctions, f_putc, f_puts, f_printf and f_gets, is also switched to Unicode. The character encoding on the file to be read via this function is assumed as FF_STRF_ENCODE. If the character encoding on the file differs from that on the API, it is converted in this function. In this case, input characters with wrong encoding will be lost.
-This is a wrapper function of f_read function. Available when FF_USE_STRFUNC >= 1. When it is set to 2, '\r's contained in the file are stripped out.
-The f_lseek function moves the file read/write pointer of an open file object. It can also be used to expand the file size (cluster pre-allocation).
- --FRESULT f_lseek ( - FIL* fp, /* [IN] File object */ - FSIZE_t ofs /* [IN] Offset of file read/write pointer to be set */ -); --
-FRESULT f_rewind ( - FIL* fp /* [IN] File object */ -); --
-FR_OK, -FR_DISK_ERR, -FR_INT_ERR, -FR_INVALID_OBJECT, -FR_TIMEOUT -
-File read/write ponter in the open file object points the data byte to be read/written at next read/write operation. It advances as the number of bytes read/written. The f_lseek function moves the file read/write pointer without any read/write operation to the file. The f_rewind function is impremented as a macro.
--#define f_rewind(fp) f_lseek((fp), 0) --
If an offset beyond the file size is specified in write mode, the file size is expanded to the specified offset. The file data in the expanded part is undefined, because no data is written to the file in this process. This is suitable to pre-allocate a data area to the file quickly for fast write operation. When a contiguous data area needs to be allocated to the file, use f_expand function instead. After the f_lseek function succeeded, the current read/write pointer should be checked in order to make sure the read/write pointer has been moved correctry. In case of the read/write pointer is not pointing expected offset, either of followings has been occured.
-The fast seek feature enables fast backward/long seek operations without FAT access by using an on-memory CLMT (cluster link map table). It is applied to f_read and f_write function as well, however, the file size cannot be expanded by f_write, f_lseek function while the file is at fast seek mode.
-The fast seek mode is available when FF_USE_FASTSEEK = 1. The CLMT must be created into the DWORD array prior to use the fast seek mode. To create the CLMT, set address of the DWORD array to the member cltbl in the open file object, set the size of array in unit of items to the cltbl[0] and then call f_lseek function with ofs = CREATE_LINKMAP. After the function succeeded, no FAT access is occured in subsequent f_read, f_write, f_lseek function to the file. The number of items used or required is returned into the cltbl[0]. The number of items needed is (number of the file fragments + 1) * 2. For example, 12 items in the array will be used for the file fragmented in 5 portions. If the function failed with FR_NOT_ENOUGH_CORE, the size of given array is insufficient for the file.
-Available when FF_FS_MINIMIZE <= 2. To use fast seek function, FF_USE_FASTSEEK needs to be set 1 to enable this feature.
-- /* Open file */ - fp = malloc(sizeof (FIL)); - res = f_open(fp, "file.dat", FA_READ|FA_WRITE); - if (res) ... - - /* Set read/write pointer to 5000 */ - res = f_lseek(fp, 5000); - - /* Set read/write pointer to end of the file to append data */ - res = f_lseek(fp, f_size(fp)); - - /* Advance read/write pointer 3000 bytes */ - res = f_lseek(fp, f_tell(fp) + 3000); - - /* Rewind read/write pointer 2000 bytes (take care on wraparound) */ - res = f_lseek(fp, f_tell(fp) - 2000); --
-/* Cluster pre-allocation (to prevent buffer overrun on streaming write) */ - - res = f_open(fp, recfile, FA_CREATE_NEW | FA_WRITE); /* Create a file */ - - res = f_lseek(fp, PRE_SIZE); /* Expand file size (cluster pre-allocation) */ - if (res || f_tell(fp) != PRE_SIZE) ... /* Check if the file has been expanded successfly */ - - res = f_lseek(fp, OFS_DATA); /* Record data stream with free from cluster allocation delay */ - ... /* Write operation should be aligned to sector boundary to optimize the write throughput */ - - res = f_truncate(fp); /* Truncate unused area */ - res = f_lseek(fp, OFS_HEADER); /* Set file header */ - ... - - res = f_close(fp); --
-/* Using fast seek mode */ - - DWORD clmt[SZ_TBL]; /* Cluster link map table buffer */ - - res = f_open(fp, fname, FA_READ | FA_WRITE); /* Open a file */ - - res = f_lseek(fp, ofs1); /* This is normal seek (cltbl is nulled on file open) */ - - fp->cltbl = clmt; /* Enable fast seek mode (cltbl != NULL) */ - clmt[0] = SZ_TBL; /* Set table size */ - res = f_lseek(fp, CREATE_LINKMAP); /* Create CLMT */ - ... - - res = f_lseek(fp, ofs2); /* This is fast seek */ --
The f_mkdir function creates a new directory.
--FRESULT f_mkdir ( - const TCHAR* path /* [IN] Directory name */ -); --
-FR_OK, -FR_DISK_ERR, -FR_INT_ERR, -FR_NOT_READY, -FR_NO_PATH, -FR_INVALID_NAME, -FR_DENIED, -FR_EXIST, -FR_WRITE_PROTECTED, -FR_INVALID_DRIVE, -FR_NOT_ENABLED, -FR_NO_FILESYSTEM, -FR_TIMEOUT, -FR_NOT_ENOUGH_CORE -
-This function creates a new directory. To remove a directory, use f_unlink function.
-Available when FF_FS_READONLY == 0 and FF_FS_MINIMIZE == 0.
-
- res = f_mkdir("sub1");
- if (res) die(res);
- res = f_mkdir("sub1/sub2");
- if (res) die(res);
- res = f_mkdir("sub1/sub2/sub3");
- if (res) die(res);
-
-The f_mkfs function creates an FAT/exFAT volume on the logical drive.
--FRESULT f_mkfs ( - const TCHAR* path, /* [IN] Logical drive number */ - const MKFS_PARM* opt,/* [IN] Format options */ - void* work, /* [-] Working buffer */ - UINT len /* [IN] Size of working buffer */ -); --
-FR_OK, -FR_DISK_ERR, -FR_NOT_READY, -FR_WRITE_PROTECTED, -FR_INVALID_DRIVE, -FR_MKFS_ABORTED, -FR_INVALID_PARAMETER, -FR_NOT_ENOUGH_CORE -
-The FAT sub-type, FAT12/FAT16/FAT32, of FAT volume except exFAT is determined by only number of clusters on the volume and nothing else, according to the FAT specification issued by Microsoft. Thus the FAT sub-type of created volume depends on the volume size and the cluster size. In case of the combination of FAT type and cluter size specified by argument is not valid for the volume size, the function will fail with FR_MKFS_ABORTED.
-The allocation unit, also known as cluster, is a unit of disk space allocation for files. When the size of allocation unit is 32768 bytes, a file with 100 bytes in size occupies 32768 bytes of disk space. The space efficiency of disk usage gets worse as increasing size of allocation unit, but, on the other hand, the read/write performance increases. Therefore the size of allocation unit is a trade-off between space efficiency and performance. For the large volumes in GB order, 32768 bytes or larger, automatically selected by default, is recommended for most case unless extremely many small files are created in the volume.
-When the logical drive to be formatted is associated with a physical drive (FF_MULTI_PARTITION == 0 or VolToPart[].pt == 0) and FM_SFD flag is not specified, a partition occupies entire drive space is created and then the FAT volume is created in the partition. When FM_SFD flag is specified, the FAT volume is created without any disk partitioning.
-When the logical drive to be formatted is associated with a specific partition by multiple partition feature (FF_MULTI_PARTITION == 1 and VolToPart[].pt > 0), the FAT volume is created in the partition of the physical drive specified by volume mapping table and FM_SFD flag is ignored. The hosting physical drive needs to be partitioned with f_fdisk function or any partitioning tool prior to create the FAT volume with this function. If the partition is not exist, the function aborts with FR_MKFS_ABORTED.
-There are three standard disk partitioning formats, MBR, GPT and SFD. The MBR format, also known as FDISK format, is usually used for harddisk, memory card and U disk. It can divide a physical drive into one or more partitions with a partition table. The GPT, GUID Partition Table, is a newly defined patitioning format for large storage devices. FatFs suppors the GPT only when 64-bit LBA is enabled. The SFD, Super-Floppy Disk, is non-partitioned disk format. The FAT volume is located at LBA 0 and occupies the entire physical drive without any disk partitioning. It is usually used for floppy disk, optical disk and most super-floppy media. Some combination of systems and media support only either partitioned format or non-partitioned format and the other is not supported.
-Some systems manage the partitions in the on-board storage in non-standard format. The partitions are mapped as physical drives identified by pdrv in disk_* functions. For such systems, SFD format is suitable to create the FAT volume in the partition.
-Available when FF_FS_READOLNY == 0 and FF_USE_MKFS == 1.
--/* Format default drive and create a file */ -int main (void) -{ - FATFS fs; /* Filesystem object */ - FIL fil; /* File object */ - FRESULT res; /* API result code */ - UINT bw; /* Bytes written */ - BYTE work[FF_MAX_SS]; /* Work area (larger is better for processing time) */ - - - /* Format the default drive with default parameters */ - res = f_mkfs("", 0, work, sizeof work); - if (res) ... - - /* Give a work area to the default drive */ - f_mount(&fs, "", 0); - - /* Create a file as new */ - res = f_open(&fil, "hello.txt", FA_CREATE_NEW | FA_WRITE); - if (res) ... - - /* Write a message */ - f_write(&fil, "Hello, World!\r\n", 15, &bw); - if (bw != 15) ... - - /* Close the file */ - f_close(&fil); - - /* Unregister work area */ - f_mount(0, "", 0); - - ... --
Example of volume size and format parameters, Volume management, f_fdisk
-The f_mount fucntion gives work area to the FatFs module.
--FRESULT f_mount ( - FATFS* fs, /* [IN] Filesystem object */ - const TCHAR* path, /* [IN] Logical drive number */ - BYTE opt /* [IN] Initialization option */ -); --
-FRESULT f_unmount ( - const TCHAR* path /* [IN] Logical drive number */ -); --
-FR_OK, -FR_INVALID_DRIVE, -FR_DISK_ERR, -FR_NOT_READY, -FR_NOT_ENABLED, -FR_NO_FILESYSTEM -
-FatFs requires work area (filesystem object) for each logical drives (FAT volumes). Prior to perform any file/directory operations, a filesystem object needs to be registered with f_mount function for the logical drive. The file/directory API functions get ready to work after this procedure. Some volume management functions, f_mkfs, f_fdisk and f_setcp, do not want a filesystem object.
-The f_mount function registers/unregisters a filesystem object to the FatFs module as follows:
-If there is any open object of file or directory on the logical drive, the object will be invalidated by this function.
-If forced mounting is not specified (opt = 0), this function always succeeds regardless of the physical drive status. It only clears (de-initializes) the given work area and registers its address to the internal table and no activity of the physical drive in this function. The volume mount process will be attempted on subsequent file/directroy function if the filesystem object is not initialized. (delayed mounting) The volume mount processes, initialize the corresponding physical drive, find the FAT volume in it and then initialize the work area, is performed in the subsequent file/directory functions when either of following conditions is true.
-If the function with forced mounting (opt = 1) failed with FR_NOT_READY, it means that the filesystem object has been registered successfully but the volume is currently not ready to work. The volume mount process will be attempted on subsequent file/directroy function.
-If implementation of the disk I/O layer lacks asynchronous media change detection, application program needs to perform f_mount function after each media change to force cleared the filesystem object.
-To unregister the work area, specify a NULL to the fs, and then the work area can be discarded. f_unmount function is implemented as a macro.
--#define f_unmount(path) f_mount(0, path, 0) --
Always available.
-
-int main (void)
-{
- FATFS *fs; /* Ponter to the filesystem object */
-
-
- fs = malloc(sizeof (FATFS)); /* Get work area for the volume */
- f_mount(fs, "", 0); /* Mount the default drive */
-
- f_open(... /* Here any file API can be used */
-
- ...
-
- f_mount(fs, "", 0); /* Re-mount the default drive to reinitialize the filesystem */
-
- ...
-
- f_mount(0, "", 0); /* Unmount the default drive */
- free(fs); /* Here the work area can be discarded */
-
- ...
-}
-
-The f_open function opens a file.
--FRESULT f_open ( - FIL* fp, /* [OUT] Pointer to the file object structure */ - const TCHAR* path, /* [IN] File name */ - BYTE mode /* [IN] Mode flags */ -); --
| Flags | Meaning |
|---|---|
| FA_READ | Specifies read access to the file. Data can be read from the file. |
| FA_WRITE | Specifies write access to the file. Data can be written to the file. Combine with FA_READ for read-write access. |
| FA_OPEN_EXISTING | Opens a file. The function fails if the file is not existing. (Default) |
| FA_CREATE_NEW | Creates a new file. The function fails with FR_EXIST if the file is existing. |
| FA_CREATE_ALWAYS | Creates a new file. If the file is existing, it will be truncated and overwritten. |
| FA_OPEN_ALWAYS | Opens the file if it is existing. If not, a new file will be created. |
| FA_OPEN_APPEND | Same as FA_OPEN_ALWAYS except the read/write pointer is set end of the file. |
| POSIX | FatFs |
|---|---|
| "r" | FA_READ |
| "r+" | FA_READ | FA_WRITE |
| "w" | FA_CREATE_ALWAYS | FA_WRITE |
| "w+" | FA_CREATE_ALWAYS | FA_WRITE | FA_READ |
| "a" | FA_OPEN_APPEND | FA_WRITE |
| "a+" | FA_OPEN_APPEND | FA_WRITE | FA_READ |
| "wx" | FA_CREATE_NEW | FA_WRITE |
| "w+x" | FA_CREATE_NEW | FA_WRITE | FA_READ |
-FR_OK, -FR_DISK_ERR, -FR_INT_ERR, -FR_NOT_READY, -FR_NO_FILE, -FR_NO_PATH, -FR_INVALID_NAME, -FR_DENIED, -FR_EXIST, -FR_INVALID_OBJECT, -FR_WRITE_PROTECTED, -FR_INVALID_DRIVE, -FR_NOT_ENABLED, -FR_NO_FILESYSTEM, -FR_TIMEOUT, -FR_LOCKED, -FR_NOT_ENOUGH_CORE, -FR_TOO_MANY_OPEN_FILES -
-The f_open function opens a file and creates a file object. The file object is an identifier for subsequent operations to the file. Open file should be closed with f_close function after the session of the file access. If any change to the file has been made and not closed prior to power off, media removal or re-mount, or the file can be collapsed.
-If duplicated file open is needed, read here carefully. However duplicated open of a file with any write mode flag is always prohibited.
-Always available. Only FA_READ and FA_OPEN_EXISTING are available for the mode flags when FF_FS_READONLY == 1.
--/* Read a text file and display it */ - -FATFS FatFs; /* Work area (filesystem object) for logical drive */ - -int main (void) -{ - FIL fil; /* File object */ - char line[100]; /* Line buffer */ - FRESULT fr; /* FatFs return code */ - - - /* Give a work area to the default drive */ - f_mount(&FatFs, "", 0); - - /* Open a text file */ - fr = f_open(&fil, "message.txt", FA_READ); - if (fr) return (int)fr; - - /* Read every line and display it */ - while (f_gets(line, sizeof line, &fil)) { - printf(line); - } - - /* Close the file */ - f_close(&fil); - - return 0; -} --
-/* Copy a file "file.bin" on the drive 1 to drive 0 */ - -int main (void) -{ - FATFS fs0, fs1; /* Work area (filesystem object) for logical drives */ - FIL fsrc, fdst; /* File objects */ - BYTE buffer[4096]; /* File copy buffer */ - FRESULT fr; /* FatFs function common result code */ - UINT br, bw; /* File read/write count */ - - - /* Give work areas to each logical drive */ - f_mount(&fs0, "0:", 0); - f_mount(&fs1, "1:", 0); - - /* Open source file on the drive 1 */ - 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_WRITE | FA_CREATE_ALWAYS); - if (fr) return (int)fr; - - /* Copy source to destination */ - for (;;) { - fr = f_read(&fsrc, buffer, sizeof buffer, &br); /* Read a chunk of data from the source file */ - if (br == 0) break; /* error or eof */ - fr = f_write(&fdst, buffer, br, &bw); /* Write it to the destination file */ - if (bw < br) break; /* error or disk full */ - } - - /* Close open files */ - f_close(&fsrc); - f_close(&fdst); - - /* Unregister work area prior to discard it */ - f_unmount("0:"); - f_unmount("1:"); - - return (int)fr; -} --
The f_opendir function opens a directory.
--FRESULT f_opendir ( - DIR* dp, /* [OUT] Pointer to the directory object structure */ - const TCHAR* path /* [IN] Directory name */ -); --
-FR_OK, -FR_DISK_ERR, -FR_INT_ERR, -FR_NOT_READY, -FR_NO_PATH, -FR_INVALID_NAME, -FR_INVALID_OBJECT, -FR_INVALID_DRIVE, -FR_NOT_ENABLED, -FR_NO_FILESYSTEM, -FR_TIMEOUT, -FR_NOT_ENOUGH_CORE, -FR_TOO_MANY_OPEN_FILES -
-The f_opendir function opens an exsisting directory and creates a directory object for subsequent f_readdir function.
-Available when FF_FS_MINIMIZE <= 1.
-The f_printf function writes formatted string to the file.
--int f_printf ( - FIL* fp, /* [IN] File object */ - const TCHAR* fmt, /* [IN] Format stirng */ - ... -); --
When the string was written successfuly, it returns number of character encoding units written to the file. When the function failed due to disk full or an error, a negative value will be returned.
-The format control directive is a sub-set of standard library shown as follows:
-- %[flag][width][precision][size]type --
| Type | Format | Argument | Length |
|---|---|---|---|
| c | Character | int, long, long long | 1 character. |
| d | Signed decimal | 1 to 11 (20 for ll) characters. | |
| u | Unsigned decimal | 1 to 10 (20 for ll) characters. | |
| o | Unsigned octal | 1 to 11 (22 for ll) characters. | |
| x X | Unsigned hexdecimal | 1 to 8 (16 for ll) characters. | |
| b | Unsigned binary | 1 to 32 characters. Limited to lower 32 digits when ll is specified. | |
| s | String | TCHAR* | As input string. Null pointer generates a null string. |
| f | Floating point (decimal) | double | 1 to 31 characters. If the number of characters exceeds 31, it writes "±OV". Not a number and infinite write "NaN" and "±INF". |
| e E | Floating point (e notation) | 4 to 31 characters. If the number of characters exceeds 31 or exponent exceeds +99, it writes "±OV". |
When FatFs is configured for Unicode API (FF_LFN_UNICODE >= 1), character encoding on the string fuctions, f_putc, f_puts, f_printf and f_gets function, is also switched to Unicode. The Unicode characters in multiple encoding unit, such as surrogate pair and multi-byte sequence, should not be divided into two function calls, or the character will be lost. The character encoding on the file to be written via this function is selected by FF_STRF_ENCODE. The characters with wrong encoding or invalid for the output encoding will be lost.
-If sprintf is used in the project and code conversion is not needed, f_write with sprintf will be efficient in code size and performance rather than f_printf.
-This is a wrapper function of f_write function. Available when FF_FS_READONLY == 0 and FF_USE_STRFUNC >= 1. When FF_USE_STRFUNC == 2, '\n's in the generated string are written as '\r'+'\n' each.
-- f_printf(fp, "%d", 1234); /* "1234" */ - f_printf(fp, "%6d,%3d%%", -200, 5); /* " -200, 5%" */ - f_printf(fp, "%-6u", 100); /* "100 " */ - f_printf(fp, "%ld", 12345678); /* "12345678" */ - f_printf(fp, "%llu", 0x100000000); /* "4294967296" (FF_PRINT_LLI) */ - f_printf(fp, "%lld", -1LL); /* "-1" (FF_PRINT_LLI) */ - f_printf(fp, "%04x", 0xA3); /* "00a3" */ - f_printf(fp, "%08lX", 0x123ABC); /* "00123ABC" */ - f_printf(fp, "%016b", 0x550F); /* "0101010100001111" */ - f_printf(fp, "%*d", 6, 100); /* " 100" */ - f_printf(fp, "%s", "abcdefg"); /* "abcdefg" */ - f_printf(fp, "%5s", "abc"); /* " abc" */ - f_printf(fp, "%-5s", "abc"); /* "abc " */ - f_printf(fp, "%.5s", "abcdefg"); /* "abcde" */ - f_printf(fp, "%-5.2s", "abcdefg"); /* "ab " */ - f_printf(fp, "%c", 'a'); /* "a" */ - f_printf(fp, "%12f", 10.0); /* " 10.000000" (FF_PRINT_FLOAT) */ - f_printf(fp, "%.4E", 123.45678); /* "1.2346E+02" (FF_PRINT_FLOAT) */ --
The f_putc funciton puts a character to the file.
--int f_putc ( - TCHAR chr, /* [IN] A character to write */ - FIL* fp /* [IN] File object */ -); --
When the character was written successfuly, it returns number of character encoding units written to the file. When the function failed due to disk full or any error, a negative value will be returned.
-When FatFs is configured for Unicode API (FF_LFN_UNICODE >= 1), character encoding on the string fuctions, f_putc, f_puts, f_printf and f_gets function, is also switched to Unicode. The character encoding on the file to be read/written via those functions is selected by FF_STRF_ENCODE. The Unicode characters in multiple encoding unit, such as surrogate pair and multi-byte sequence, cannot be written with this function.
-This is a wrapper function of f_write function. Available when FF_FS_READONLY == 0 and FF_USE_STRFUNC >= 1. When FF_USE_STRFUNC == 2, a '\n' is output as '\r'+'\n'.
-The f_puts function writes a string to the file.
--int f_puts ( - const TCHAR* str, /* [IN] String */ - FIL* fp /* [IN] File object */ -); --
When the string was written successfuly, it returns number of character encoding units written to the file. When the function failed due to disk full or any error, a negative value will be returned.
-When FatFs is configured for Unicode API (FF_LFN_UNICODE >= 1), character encoding on the string fuctions, f_putc, f_puts, f_printf and f_gets function, is also switched to Unicode. The input Unicode characters in multiple encoding unit, such as surrogate pair and multi-byte sequence, should not be divided into two function calls, or the character will be lost. The character encoding on the file to be written via this functions is selected by FF_STRF_ENCODE. The characters with wrong encoding or invalid for the output encoding will be lost.
-This is a wrapper function of f_write function. Available when FF_FS_READONLY == 0 and FF_USE_STRFUNC >= 1. When FF_USE_STRFUNC == 2, '\n's contained in the input string are output as '\r'+'\n' each.
-Most of API functions return common result code in enum type FRESULT. When an API function succeeded, it returns zero (FR_OK), otherwise it returns non-zero value indicates type of error.
- -The f_read function reads data from a file.
--FRESULT f_read ( - FIL* fp, /* [IN] File object */ - void* buff, /* [OUT] Buffer to store read data */ - UINT btr, /* [IN] Number of bytes to read */ - UINT* br /* [OUT] Number of bytes read */ -); --
-FR_OK, -FR_DISK_ERR, -FR_INT_ERR, -FR_DENIED, -FR_INVALID_OBJECT, -FR_TIMEOUT -
-The function starts to read data from the file at the file offset pointed by read/write pointer. The read/write pointer advances as number of bytes read. After the function succeeded, *br should be checked to detect end of the file. In case of *br < btr, it means the read/write pointer hit end of the file during read operation.
-Always available.
-Refer to the example in f_open.
-The f_readdir function reads an item of the directory.
--FRESULT f_readdir ( - DIR* dp, /* [IN] Directory object */ - FILINFO* fno /* [OUT] File information structure */ -); --
-FRESULT f_rewinddir ( - DIR* dp /* [IN] Directory object */ -); --
-FR_OK, -FR_DISK_ERR, -FR_INT_ERR, -FR_INVALID_OBJECT, -FR_TIMEOUT, -FR_NOT_ENOUGH_CORE -
-The f_readdir function reads a directory item, informations about the object, from the open directory. Items in the directory can be read in sequence by f_readdir function calls. When all items in the directory have been read and no item to read, a null string is stored into the fno->fname[] without any error. When a null pointer is given to the fno, the read index of the directory object is rewinded. The f_rewinddir function is implemented as a macro.
--#define f_rewinddir(dp) f_readdir((dp), 0) --
When LFN is enabled, a member altname[] is defined in the file information structure to store the short file name of the object. If the long file name is not accessible due to a reason listed below, short file name is stored to the fname[] and the altname[] has a null string.
-There is an issue on read directories in exFAT volume. The exFAT does not support short file name. This means no name can be returned on the condition above. If it is the case, "?" is returned as the file name to indicate that the object is not accessible. To avoid this problem, configure FatFs FF_LFN_UNICODE != 0 and FF_MAX_LFN == 255 to support the full feature of LFN specification.
-Dot entries ("." and "..") in the sub-directory of FAT volume are filtered out and they will never appear in the read items because exFAT lacks dot entries in the sub-directory.
-Available when FF_FS_MINIMIZE <= 1.
--FRESULT scan_files ( - char* path /* Start node to be scanned (***also used as work area***) */ -) -{ - FRESULT res; - DIR dir; - UINT i; - static FILINFO fno; - - - res = f_opendir(&dir, path); /* Open the directory */ - if (res == FR_OK) { - for (;;) { - res = f_readdir(&dir, &fno); /* Read a directory item */ - if (res != FR_OK || fno.fname[0] == 0) break; /* Break on error or end of dir */ - if (fno.fattrib & AM_DIR) { /* It is a directory */ - i = strlen(path); - sprintf(&path[i], "/%s", fno.fname); - res = scan_files(path); /* Enter the directory */ - if (res != FR_OK) break; - path[i] = 0; - } else { /* It is a file. */ - printf("%s/%s\n", path, fno.fname); - } - } - f_closedir(&dir); - } - - return res; -} - - -int main (void) -{ - FATFS fs; - FRESULT res; - char buff[256]; - - - res = f_mount(&fs, "", 1); - if (res == FR_OK) { - strcpy(buff, "/"); - res = scan_files(buff); - } - - return res; -} --
The f_rename function renames and/or moves a file or sub-directory.
--FRESULT f_rename ( - const TCHAR* old_name, /* [IN] Old object name */ - const TCHAR* new_name /* [IN] New object name */ -); --
-FR_OK, -FR_DISK_ERR, -FR_INT_ERR, -FR_NOT_READY, -FR_NO_FILE, -FR_NO_PATH, -FR_INVALID_NAME, -FR_EXIST, -FR_WRITE_PROTECTED, -FR_INVALID_DRIVE, -FR_NOT_ENABLED, -FR_NO_FILESYSTEM, -FR_TIMEOUT, -FR_LOCKED, -FR_NOT_ENOUGH_CORE -
-Renames a file or sub-directory and can also move it to other directory in the same volume. The object to be renamed must not be an open object, or the FAT volume can be collapsed. Such the wrong operation is rejected safely when file lock function is enabled.
-Available when FF_FS_READONLY == 0 and FF_FS_MINIMIZE == 0.
-- /* Rename an object in the default drive */ - f_rename("oldname.txt", "newname.txt"); - - /* Rename an object in the drive 2 */ - f_rename("2:oldname.txt", "newname.txt"); - - /* Rename an object and move it to another directory in the drive */ - f_rename("log.txt", "old/log0001.txt"); --
The DIR structure is used for the work area to read a directory by f_oepndir, f_readdir, f_findfirst and f_findnext function. Application program must not modify any member in this structure, or f_readdir function will not work properly.
--typedef struct { - FFOBJID obj; /* Object identifier */ - DWORD dptr; /* Current read/write offset */ - DWORD clust; /* Current cluster */ - LBA_t sect; /* Current sector */ - BYTE* dir; /* Pointer to the current SFN entry in the win[] */ - BYTE* fn; /* Pointer to the SFN buffer (in/out) {file[8],ext[3],status[1]} */ -#if FF_USE_LFN - DWORD blk_ofs; /* Offset of the entry block (0xFFFFFFFF:Invalid) */ - WCHAR* lfn; /* Pointer to the LFN working buffer (in/out) */ -#endif -#if FF_USE_FIND - const TCHAR* pat; /* Ponter to the matching pattern */ -#endif -} DIR; --
The f_setcp function sets the active code page.
--FRESULT f_setcp ( - WORD cp /* [IN] Code page to be set */ -); --
| Value | Meaning |
|---|---|
| 0 | Initial value (any extended character cannot be used) |
| 437 | U.S. |
| 720 | Arabic |
| 737 | Greek |
| 771 | KBL |
| 775 | Baltic |
| 850 | Latin 1 |
| 852 | Latin 2 |
| 855 | Cyrillic |
| 857 | Turkish |
| 860 | Portuguese |
| 861 | Icelandic |
| 862 | Hebrew |
| 863 | Canadian French |
| 864 | Arabic |
| 865 | Nordic |
| 866 | Russian |
| 869 | Greek 2 |
| 932 | Japanese (DBCS) |
| 936 | Simplified Chinese (DBCS) |
| 949 | Korean (DBCS) |
| 950 | Traditional Chinese (DBCS) |
The f_setcp function sets the active code page for the path name. Also code conversion of string functions will be affected by the setting of code page when FF_LFN_UNICODE >= 1 and FF_STRF_ENCODE == 0. Because the initial setting of the code page is 0 and API function with extended character will not work properly, a valid code page needs to be set on the system start-up and it should not be changed on the fly.
-Available when FF_CODE_PAGE == 0.
-The f_setlabel function sets/removes the label of a volume.
--FRESULT f_setlabel ( - const TCHAR* label /* [IN] Volume label to be set */ -); --
-FR_OK, -FR_DISK_ERR, -FR_INT_ERR, -FR_NOT_READY, -FR_INVALID_NAME, -FR_WRITE_PROTECTED, -FR_INVALID_DRIVE, -FR_NOT_ENABLED, -FR_NO_FILESYSTEM, -FR_TIMEOUT -
-When the string has a drive prefix, the volume label will be set to the volume specified by the drive prefix. Unix style volume ID cannot be used to specify the volume. If drive number is not specified, the volume label will be set to the default drive. If length of the given volume label is zero, the volume label on the volume will be removed. The format of the volume label is as shown below:
-Remark: The standard system (Windows) has a problem at the volume label with a heading \xE5 on the FAT volume. To avoid this problem, this function rejects such volume label as invalid name.
-Available when FF_FS_READONLY == 0 and FF_USE_LABEL == 1.
-- /* Set volume label to the default drive */ - f_setlabel("DATA DISK"); - - /* Set volume label to the drive 2 */ - f_setlabel("2:DISK 3 OF 4"); - - /* Remove volume label of the drive 2 */ - f_setlabel("2:"); --
The FATFS structure (filesystem object) holds dynamic work area of individual logical drives. It is given by application program and registerd/unregisterd to the FatFs module with f_mount function. Initialization of the structure is done by volume mount process whenever necessary. Application program must not modify any member in this structure, or the FAT volume will be collapsed.
--typedef struct { - BYTE fs_type; /* FAT type (0, FS_FAT12, FS_FAT16, FS_FAT32 or FS_EXFAT) */ - BYTE pdrv; /* Hosting physical drive of this volume */ - BYTE n_fats; /* Number of FAT copies (1,2) */ - BYTE wflag; /* win[] flag (b0:win[] is dirty) */ - BYTE fsi_flag; /* FSINFO flags (b7:Disabled, b0:Dirty) */ - WORD id; /* Volume mount ID */ - WORD n_rootdir; /* Number of root directory entries (FAT12/16) */ - WORD csize; /* Sectors per cluster */ -#if FF_MAX_SS != FF_MIN_SS - WORD ssize; /* Sector size (512,1024,2048 or 4096) */ -#endif -#if FF_FS_EXFAT - BYTE* dirbuf; /* Directory entry block scratchpad buffer */ -#endif -#if FF_FS_REENTRANT - FF_SYNC_t sobj; /* Identifier of sync object */ -#endif -#if !FF_FS_READONLY - DWORD last_clust; /* FSINFO: Last allocated cluster (0xFFFFFFFF if invalid) */ - DWORD free_clust; /* FSINFO: Number of free clusters (0xFFFFFFFF if invalid) */ -#endif -#if FF_FS_RPATH - DWORD cdir; /* Cluster number of current directory (0:root) */ -#if FF_FS_EXFAT - DWORD cdc_scl; /* Containing directory start cluster (invalid when cdir is 0) */ - DWORD cdc_size; /* b31-b8:Size of containing directory, b7-b0: Chain status */ - DWORD cdc_ofs; /* Offset in the containing directory (invalid when cdir is 0) */ -#endif -#endif - DWORD n_fatent; /* Number of FAT entries (Number of clusters + 2) */ - DWORD fsize; /* Sectors per FAT */ - LBA_t volbase; /* Volume base LBA */ - LBA_t fatbase; /* FAT base LBA */ - LBA_t dirbase; /* Root directory base (LBA|Cluster) */ - LBA_t database; /* Data base LBA */ - LBA_t winsect; /* Sector LBA appearing in the win[] */ - BYTE win[FF_MAX_SS]; /* Disk access window for directory, FAT (and file data at tiny cfg) */ -} FATFS; --
The FIL structure (file object) holds the state of an open file. It is created by f_open function and discarded by f_close function. Application program must not modify any member in this structure except for cltbl, or the FAT volume will be collapsed. Note that a sector buffer is defined in this structure at non-tiny configuration (FF_FS_TINY == 0), so that the FIL structures at that configuration should not be defined as auto variable.
- --typedef struct { - FFOBJID obj; /* Object identifier */ - BYTE flag; /* File object status flags */ - BYTE err; /* Abort flag (error code) */ - FSIZE_t fptr; /* File read/write pointer (Byte offset origin from top of the file) */ - DWORD clust; /* Current cluster of fptr (One cluster behind if fptr is on the cluster boundary. Invalid if fptr == 0.) */ - LBA_t sect; /* Current data sector (Can be invalid if fptr is on the cluster boundary.)*/ -#if !FF_FS_READONLY - LBA_t dir_sect; /* Sector number containing the directory entry */ - BYTE* dir_ptr; /* Ponter to the directory entry in the window */ -#endif -#if FF_USE_FASTSEEK - DWORD* cltbl; /* Pointer to the cluster link map table (Nulled on file open. Set by application.) */ -#endif -#if !FF_FS_TINY - BYTE buf[FF_MAX_SS]; /* File private data transfer buffer (Always valid if fptr is not on the sector boundary but can be invalid if fptr is on the sector boundary.) */ -#endif -} FIL; -- -
The FILINFO structure holds information about the object retrieved by f_readdir, f_findfirst, f_findnext and f_stat function. Be careful in the size of structure when LFN is enabled.
--typedef struct { - FSIZE_t fsize; /* File size */ - WORD fdate; /* Last modified date */ - WORD ftime; /* Last modified time */ - BYTE fattrib; /* Attribute */ -#if FF_USE_LFN - TCHAR altname[FF_SFN_BUF + 1]; /* Alternative object name */ - TCHAR fname[FF_LFN_BUF + 1]; /* Primary object name */ -#else - TCHAR fname[12 + 1]; /* Object name */ -#endif -} FILINFO; --
| Flag | Meaning |
|---|---|
| AM_RDO | Read-only. Write mode open and deleting is rejected. |
| AM_HID | Hidden. Should not be shown in normal directory listing. |
| AM_SYS | System. Used by system and should not be accessed. |
| AM_ARC | Archive. Set on new creation or any modification to the file. |
| AM_DIR | Directory. This is not a file but a sub-directory container. |
The f_size function gets the size of a file.
--FSIZE_t f_size ( - FIL* fp /* [IN] File object */ -); --
Returns the size of the file in unit of byte.
-In this revision, the f_size function is implemented as a macro. It does not have any validation and mutual exclusion.
-
-#define f_size(fp) ((fp)->obj.objsize)
-
-Always available.
-The f_stat function checks the existence of a file or sub-directory.
--FRESULT f_stat ( - const TCHAR* path, /* [IN] Object name */ - FILINFO* fno /* [OUT] FILINFO structure */ -); --
-FR_OK, -FR_DISK_ERR, -FR_INT_ERR, -FR_NOT_READY, -FR_NO_FILE, -FR_NO_PATH, -FR_INVALID_NAME, -FR_INVALID_DRIVE, -FR_NOT_ENABLED, -FR_NO_FILESYSTEM, -FR_TIMEOUT, -FR_NOT_ENOUGH_CORE -
-The f_stat function checks the existence of a file or sub-directory in the directory. If it is not exist, the function returns with FR_NO_FILE. If it is exist, the function returns with FR_OK and the informations about the object, size, timestamp and attribute, is stored to the file information structure. For details of the file information, refer to the FILINFO structure and f_readdir function.
-Note that the file information comes from the meta data in the directory. If the file has been opend and modified, the file will need to be synched or closed in order to obtain the latest file information.
-Available when FF_FS_MINIMIZE == 0.
-
- FRESULT fr;
- FILINFO fno;
- const char *fname = "file.txt";
-
-
- printf("Test for \"%s\"...\n", fname);
-
- fr = f_stat(fname, &fno);
- switch (fr) {
-
- case FR_OK:
- printf("Size: %lu\n", fno.fsize);
- printf("Timestamp: %u-%02u-%02u, %02u:%02u\n",
- (fno.fdate >> 9) + 1980, fno.fdate >> 5 & 15, fno.fdate & 31,
- fno.ftime >> 11, fno.ftime >> 5 & 63);
- printf("Attributes: %c%c%c%c%c\n",
- (fno.fattrib & AM_DIR) ? 'D' : '-',
- (fno.fattrib & AM_RDO) ? 'R' : '-',
- (fno.fattrib & AM_HID) ? 'H' : '-',
- (fno.fattrib & AM_SYS) ? 'S' : '-',
- (fno.fattrib & AM_ARC) ? 'A' : '-');
- break;
-
- case FR_NO_FILE:
- printf("\"%s\" is not exist.\n", fname);
- break;
-
- default:
- printf("An error occured. (%d)\n", fr);
- }
-
-The f_tell function gets the current read/write pointer of a file.
--FSIZE_t f_tell ( - FIL* fp /* [IN] File object */ -); --
Returns current read/write pointer of the file.
-In this revision, the f_tell function is implemented as a macro. It does not have any validation and mutual exclusion.
-
-#define f_tell(fp) ((fp)->fptr)
-
-Always available.
-The f_truncate function truncates the file size.
--FRESULT f_truncate ( - FIL* fp /* [IN] File object */ -); --
-FR_OK, -FR_DISK_ERR, -FR_INT_ERR, -FR_DENIED, -FR_INVALID_OBJECT, -FR_TIMEOUT -
-The f_truncate function truncates the file size to the current file read/write pointer. This function has no effect if the file read/write pointer is already pointing end of the file.
-Available when FF_FS_READONLY == 0 and FF_FS_MINIMIZE == 0.
-The f_unlink function removes a file or sub-directory from the volume.
--FRESULT f_unlink ( - const TCHAR* path /* [IN] Object name */ -); --
-FR_OK, -FR_DISK_ERR, -FR_INT_ERR, -FR_NOT_READY, -FR_NO_FILE, -FR_NO_PATH, -FR_INVALID_NAME, -FR_DENIED, -FR_WRITE_PROTECTED, -FR_INVALID_DRIVE, -FR_NOT_ENABLED, -FR_NO_FILESYSTEM, -FR_TIMEOUT, -FR_LOCKED, -FR_NOT_ENOUGH_CORE -
--If condition of the object to be removed is applicable to the following terms, the function will be rejected.
Available when FF_FS_READONLY == 0 and FF_FS_MINIMIZE == 0.
-The f_utime function changes the timestamp of a file or sub-directory.
--FRESULT f_utime ( - const TCHAR* path, /* [IN] Object name */ - const FILINFO* fno /* [IN] Time and data to be set */ -); --
-FR_OK, -FR_DISK_ERR, -FR_INT_ERR, -FR_NOT_READY, -FR_NO_FILE, -FR_NO_PATH, -FR_INVALID_NAME, -FR_WRITE_PROTECTED, -FR_INVALID_DRIVE, -FR_NOT_ENABLED, -FR_NO_FILESYSTEM, -FR_TIMEOUT, -FR_NOT_ENOUGH_CORE -
-The f_utime function changes the timestamp of a file or sub-directory
-
-FRESULT set_timestamp (
- char *obj, /* Pointer to the file name */
- int year,
- int month,
- int mday,
- int hour,
- int min,
- int sec
-)
-{
- FILINFO fno;
-
- fno.fdate = (WORD)(((year - 1980) * 512U) | month * 32U | mday);
- fno.ftime = (WORD)(hour * 2048U | min * 32U | sec / 2U);
-
- return f_utime(obj, &fno);
-}
-
-Available when FF_FS_READONLY == 0 and FF_USE_CHMOD == 1.
-The f_write writes data to a file.
--FRESULT f_write ( - FIL* fp, /* [IN] Pointer to the file object structure */ - const void* buff, /* [IN] Pointer to the data to be written */ - UINT btw, /* [IN] Number of bytes to write */ - UINT* bw /* [OUT] Pointer to the variable to return number of bytes written */ -); --
-FR_OK, -FR_DISK_ERR, -FR_INT_ERR, -FR_DENIED, -FR_INVALID_OBJECT, -FR_TIMEOUT -
-The function starts to write data to the file at the file offset pointed by read/write pointer. The read/write pointer advances as number of bytes written. After the function succeeded, *bw should be checked to detect the disk full. In case of *bw < btw, it means the volume got full during the write operation. The function can take a time when the volume is full or close to full.
-Available when FF_FS_READONLY == 0.
-Refer to the example in f_open.
-5|$v_?@p zD22$2B9!Hv(w!_-ONH{2@X(|D%LTzp!h2Ik`AJ;)>O*`K?IOq&o#fDJ?$)$mTiEB? zwhL*O4>%>E8%r|dgoWYS^E+G5b%iaHqu2bEN70(;*84?pv4dmpCY 26mcXQwj^iJcYjiQ`0l1l(jHPV%_ z=s`W+JyFoJHTUCc!z3Si!2eYLfACfxjkiwiOnLhkeXa;Vu#>6)d?}an;%uXce={%N zpeO JCZSg3s;*ea>qc4sI4Y8wh z_l|RWk|iZatM_J&FoXWHoxN8iRDq+v`~yd>VDbAAsZBlOR2GiQJ#Bg1N#E#Uu`MKK zdR3LK!J )o$dz9ptJ-WOWXX_D5mBEa;Dwn{(gb>s;eqIXPq zLOPr>R(j^eM#z-iveY(_ffN0y-SI&*S4IpN42(4I!0xtg-qKUj_wUy1gpiE&{mgZk zupyzRad+=}JWY)hwshOct|kfQCFA$Zv#2()sT$36;nJQ=BMb&vnZY*me(t_f2xG0W zKw!dUvU@v8$}!3XAC ^Osc*sggH&6n;FRs&v45hgK() z`SRu6sBA_V()< !8A=eSXR(iLS5A8%%?siFs+X1|{{$6=*? z`Z`#jMe@-tX0#NPD0WAM5(>LgC7LO?@eJ!aqHr#A V^M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6GJ1hNyMsN<$c}3JFBBFa~Wl_SP`$OR9bnF0iYhBo$oql(H-+u#u?be5S|EX;Gf8U z6+o L@_B}e z!cF~>m0B{kc;g4@dT9d??EJlKDEtJKs7(7@*K;b+RP1y}#aj)$>89biDyJp`k{6;} z3(|l;ZDxcba{zt}-%h!VqT|nis&rhxV0%tFPNLU%7k+@Dh}~odhPhKo%Z=C{4msXy zNMBm-z=uXE4Q0;Ldi_5@F{4W7(~k~(9|V|D7!e%*F$vbDqYX2rUm&D$1=zcx*0AB) zDjBn&C=ed2F24dLRWK)l#Ij5=QfE6lC_uuclc4S}mp&A?nnp4ES6l1TMCAbhmI5k~ zGg@ZTg(1jZ!xJBZp5}ia6cZ%vqrm4F+K-+Vhb~VXMY%RJ0if3_?RS5r$?y^Q3!=X( zGbXR5`ubr3xlPqve y0x9)$>XFY!ZPiE!x9X^Ya9EZ?jB(OMfyGif~5dyVa L+Bd6iAj1C(*`FA8 diff --git a/documents/res/funcs.png b/documents/res/funcs.png deleted file mode 100644 index f381ec5f064611f99b233605e0489b24605d727d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 26839 zcmce-cT|&Kw=Nn$K$N1QA{{|MsY-x|ND~1OkSe_?gx;$VLO@hRn$!?Nla5sBgz8VE zB=jmJ1f;jn2@nD&eEZwuoHNG0`|kVC{euz0de>ZYu6M3EpJ%Q~gw889hAV7W0001k z`itj!001Q(0HDadOhf*Qn{<{1`Qwtkl9mzx@FVu>=^JYDcRG(3Cf)!5WBbJqMUpTh zI{@Gip#EIR;GN|rmMM{=6Z+>E_k_S}rjGCa=5po6vrV=v>Xfgy);~WsQC)ZsC{ih` zSp=Zzcu32aQ%1hzW+eUQ%7*xxi^cmhHn(-h=2i 3oFSth`?L_TGpyG?DC))R2o9h zM!aTQf;M#byhlz08|hUOyzV4MgI00Bb{*`Ze^xempl{N2tPJv-n3z2JB_m^9@L@fs zD=NK?7s%(P7s~mVWz!k_n5CI7;VS0cFSbOtmhq-e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