R0.15b
This commit is contained in:
@@ -106,17 +106,17 @@ The FatFs module is a middleware written in ANSI C (C89). There is no platform d
|
||||
<tr><th></th><th>ARM7<small><br>32bit</small></th><th>ARM7<small><br>Thumb</small></th><th>CM3<small><br>Thumb-2</small></th><th>AVR</th><th>H8/300H</th><th>PIC24</th><th>RL78</th><th>V850ES</th><th>SH-2A</th><th>RX600</th><th>IA-32</th></tr>
|
||||
<tr class="cal"> <td>Compiler</td><td>GCC</td><td>GCC</td><td>GCC</td><td>GCC</td><td>CH38</td><td>C30</td><td>CC78K0R</td><td>CA850</td><td>SHC</td><td>RXC</td><td>MSC</td></tr>
|
||||
<!-- ARM Thumb CM3 AVR H8 PIC24 RL78 V850ES SH-2A RX600 IA-32 -->
|
||||
<tr class="ral"><td class="cal">.text (Def, R/W)</td><td>10.4k</td><td>6.7k</td><td>6.1k</td><td>12.5k</td><td>11.0k</td><td>11.4k</td><td>13.0k</td><td>8.9k</td><td>9.2k</td><td>6.5k</td><td>8.9k</td></tr>
|
||||
<tr class="ral"><td class="cal">.text (Min, R/W)</td> <td>7.0k</td><td>4.7k</td><td>4.2k</td> <td>8.5k</td> <td>7.6k</td> <td>7.9k</td> <td>9.5k</td><td>6.3k</td><td>6.4k</td><td>4.7k</td><td>6.4k</td></tr>
|
||||
<tr class="ral"><td class="cal">.text (Def, R/O)</td> <td>4.9k</td><td>3.2k</td><td>2.7k</td> <td>6.1k</td> <td>5.2k</td> <td>5.4k</td> <td>6.5k</td><td>4.3k</td><td>4.2k</td><td>3.2k</td><td>4.3k</td></tr>
|
||||
<tr class="ral"><td class="cal">.text (Min, R/O)</td> <td>3.7k</td><td>2.5k</td><td>2.1k</td> <td>4.4k</td> <td>4.0k</td> <td>4.2k</td> <td>5.1k</td><td>3.4k</td><td>3.3k</td><td>2.5k</td><td>3.5k</td></tr>
|
||||
<tr class="ral"><td class="cal">.text (Def, R/W)</td><td>10.5k</td><td>6.7k</td><td>6.1k</td><td>12.6k</td><td>11.0k</td><td>11.4k</td><td>13.0k</td><td>8.9k</td><td>9.2k</td><td>6.5k</td><td>8.9k</td></tr>
|
||||
<tr class="ral"><td class="cal">.text (Min, R/W)</td> <td>7.0k</td><td>4.7k</td><td>4.2k</td> <td>8.5k</td> <td>7.6k</td> <td>7.9k</td> <td>9.4k</td><td>6.3k</td><td>6.4k</td><td>4.7k</td><td>6.3k</td></tr>
|
||||
<tr class="ral"><td class="cal">.text (Def, R/O)</td> <td>4.9k</td><td>3.2k</td><td>2.8k</td> <td>6.1k</td> <td>5.2k</td> <td>5.5k</td> <td>6.5k</td><td>4.4k</td><td>4.2k</td><td>3.2k</td><td>4.3k</td></tr>
|
||||
<tr class="ral"><td class="cal">.text (Min, R/O)</td> <td>3.7k</td><td>2.5k</td><td>2.1k</td> <td>4.4k</td> <td>4.0k</td> <td>4.2k</td> <td>5.0k</td><td>3.4k</td><td>3.3k</td><td>2.5k</td><td>3.4k</td></tr>
|
||||
<tr class="ral"><td class="cal">.bss</td><td>V*4 + 2</td><td>V*4 + 2</td><td>V*4 + 2</td><td>V*2 + 2</td><td>V*4 + 2</td><td>V*2 + 2</td><td>V*2 + 2</td><td>V*4 + 2</td><td>V*4 + 2</td><td>V*4 + 2</td><td>V*4 + 2</td></tr>
|
||||
<tr class="ral"><td class="cal">Work area<br><small>(FF_FS_TINY == 0)</small></td><td>V*564<br>+ F*552</td><td>V*564<br>+ F*552</td><td>V*564<br>+ F*552</td><td>V*560<br>+ F*546</td><td>V*560<br>+ F*546</td><td>V*560<br>+ F*546</td><td>V*560<br>+ F*546</td><td>V*564<br>+ F*552</td><td>V*564<br>+ F*552</td><td>V*564<br>+ F*552</td><td>V*564<br>+ F*552</td></tr>
|
||||
<tr class="ral"><td class="cal">Work area<br><small>(FF_FS_TINY == 1)</small></td><td>V*564<br>+ F*40</td><td>V*564<br>+ F*40</td><td>V*564<br>+ F*40</td><td>V*560<br>+ F*34</td><td>V*560<br>+ F*34</td><td>V*560<br>+ F*34</td><td>V*560<br>+ F*34</td><td>V*564<br>+ F*40</td><td>V*564<br>+ F*40</td><td>V*564<br>+ F*40</td><td>V*564<br>+ F*40</td></tr>
|
||||
</table>
|
||||
<p>These are the memory usage of FatFs module without lower layer on some target systems in following condition. <em>V</em> denotes number of mounted volumes and <em>F</em> denotes number of open files. Every samples here are optimezed in code size.</p>
|
||||
<pre>
|
||||
FatFs R0.15 options:
|
||||
FatFs R0.15b 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)
|
||||
@@ -202,7 +202,7 @@ And any other options are left unchanged from original setting.
|
||||
<div class="para doc" id="lba64">
|
||||
<h3>64-bit LBA</h3>
|
||||
<p>LBA (Logical Block Addressing) is an addressing method to specify the location of data block, called <em>sector</em>, 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 2<sup>32</sup> 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.</p>
|
||||
<p>By default, FatFs works in 32-bit LBA for media access. FatFs can also switch it to 64-bit LBA by a configuration option <tt><a href="config.html#fs_lba64">FF_LBA64</a></tt>. It also enables GPT (GUID Partition Table) for partiotion management on the storage device. For further information about GPT, refer to <tt><a href="mkfs.html">f_mkfs</a></tt> and <tt><a href="fdisk.html">f_fdisk</a></tt> function.</p>
|
||||
<p>By default, FatFs works in 32-bit LBA for media access. FatFs can also switch it to 64-bit LBA by a configuration option <tt><a href="config.html#fs_lba64">FF_LBA64</a></tt>. It also enables GPT (GUID Partition Table) for partition management on the storage device. For further information about GPT, refer to <tt><a href="mkfs.html">f_mkfs</a></tt> and <tt><a href="fdisk.html">f_fdisk</a></tt> function.</p>
|
||||
</div>
|
||||
|
||||
<div class="para doc" id="reentrant">
|
||||
|
||||
@@ -25,7 +25,7 @@ FRESULT f_chmod (
|
||||
<h4>Parameters</h4>
|
||||
<dl class="par">
|
||||
<dt>path</dt>
|
||||
<dd>Pointer to the null-terminated string that specifies an <a href="filename.html">object</a> to be changed</dd>
|
||||
<dd>Pointer to the null-terminated string that specifies an <a href="filename.html">object</a> to be changed. If a null pointer is given, the function fails with <tt>FR_INVALID_OBJECT</tt>.</dd>
|
||||
<dt>attr</dt>
|
||||
<dd>Attribute flags to be set in one or more combination of the following flags. The specified flags are set and others are cleard.<br>
|
||||
<table class="lst">
|
||||
|
||||
@@ -56,6 +56,7 @@
|
||||
<li><a href="#fs_exfat">FF_FS_EXFAT</a></li>
|
||||
<li><a href="#fs_nortc">FF_FS_NORTC</a></li>
|
||||
<li><a href="#nortc_time">FF_NORTC_MON, FF_NORTC_MDAY, FF_NORTC_YEAR</a></li>
|
||||
<li><a href="#fs_ctime">FF_FS_CTIME</a></li>
|
||||
<li><a href="#fs_nofsinfo">FF_FS_NOFSINFO</a></li>
|
||||
<li><a href="#fs_lock">FF_FS_LOCK</a></li>
|
||||
<li><a href="#fs_reentrant">FF_FS_REENTRANT</a></li>
|
||||
@@ -271,6 +272,9 @@ const char* VolumeStr[FF_VOLUMES] = {"ram","flash","sd","usb"};
|
||||
<h4 id="nortc_time">FF_NORTC_MON, FF_NORTC_MDAY, FF_NORTC_YEAR</h4>
|
||||
<p>This set of options defines the time to be used in no RTC systems. This option has no effect in read-only configuration or <tt>FF_FS_NORTC == 0</tt>.</p>
|
||||
|
||||
<h4 id="fs_ctime">FF_FS_CTIME</h4>
|
||||
<p>This option enables (1) or disables (0) to access the file creation time with <tt>FILINFO</tt> structure.</p>
|
||||
|
||||
<h4 id="fs_nofsinfo">FF_FS_NOFSINFO</h4>
|
||||
<p>0 to 3. If you need to know correct free space on the FAT32 volume, set bit 0 of this option, and <tt>f_getfree</tt> 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.</p>
|
||||
<table class="lst1">
|
||||
|
||||
@@ -58,7 +58,7 @@ DRESULT disk_write (
|
||||
<h4>Description</h4>
|
||||
<p>The specified memory address is not that always aligned to word boundary because the argument is defined as <tt>BYTE*</tt>. For more information, refer to the description of <a href="dread.html"><tt>disk_read</tt></a> function.</p>
|
||||
<p>Generally, a multiple sector write request (<tt class="arg">count</tt><tt> > 1</tt>) must not be split into single sector transactions to the storage device, or the file write throughput will be drastically decreased.</p>
|
||||
<p>FatFs expects delayed write function in 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. The write data on the <tt class="arg">buff</tt> is invalid after return from this function. The write completion request is done by <tt>CTRL_SYNC</tt> command of <tt><a href="dioctl.html">disk_ioctl</a></tt> function. Therefore, if a delayed write function is implemented, the write throughput of the filesystem will be improved.</p>
|
||||
<p>FatFs expects the disk control layer may have a delayed write feature. The write operation to the media does not need to be completed when return from this function by what media write operation is in progress or data is stored into the write-back cache. The write data on the <tt class="arg">buff</tt> is invalid after return from this function. The write completion request is done by <tt>CTRL_SYNC</tt> command of <tt><a href="dioctl.html">disk_ioctl</a></tt> function. Therefore, if a delayed write feature is implemented, the write throughput of the filesystem will be improved.</p>
|
||||
<p><em>Remarks: Application program MUST NOT call this function, or FAT structure on the volume can be collapsed.</em></p>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -67,10 +67,10 @@ FRESULT f_findfirst (
|
||||
<li><tt>*</tt> - An any string in length of zero or longer.</li>
|
||||
<li><tt>????*</tt> - An any string in length of four characters or longer.</li>
|
||||
</ul>
|
||||
<p>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 <tt>fname[]</tt> is tested when <tt>FF_USE_FIND == 1</tt> and also <tt>altname[]</tt> is tested when <tt>FF_USE_FIND == 2</tt>. There are some differences listed below between FatFs and standard systems in matching condition.</p>
|
||||
<p>Since the matching algorithm uses recursion, number of wildcards in the matching pattern is limited to four to limit the stack usage. The pattern with too many wildcards does not match any name. In LFN configuration, only <tt>fname[]</tt> is tested when <tt>FF_USE_FIND == 1</tt> and also <tt>altname[]</tt> is tested when <tt>FF_USE_FIND == 2</tt>. There are some differences listed below between FatFs and standard systems in matching condition.</p>
|
||||
<ul>
|
||||
<li><tt>"*.*"</tt> does not match any name without extension while it matches any name with or without extension in standard systems.</li>
|
||||
<li>Any pattern terminated with a dot does not match any name while it matches the name without extensiton in standard systems.</li>
|
||||
<li>The pattern terminated with a dot does not match any name while it matches the name without extensiton in standard systems.</li>
|
||||
<li><a href="filename.html#case">DBCS extended characters</a> are compared in case-sensitive when LFN is enabled with <tt>!FF_LFN_UNICODE</tt>.</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@@ -61,8 +61,8 @@ FRESULT f_rewind (
|
||||
<li>End of file. The specified <tt class="arg">ofs</tt> was clipped at end of the file in read-only mode.</li>
|
||||
<li>Disk full. There is no free space on the volume to expand the file.</li>
|
||||
</ul>
|
||||
<p>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 <tt>f_read</tt> and <tt>f_write</tt> function as well, however, the file size cannot be expanded by <tt>f_write</tt>, <tt>f_lseek</tt> function while the file is at fast seek mode.</p>
|
||||
<p>The fast seek mode is available when <tt>FF_USE_FASTSEEK = 1</tt>. The CLMT must be created into the <tt>DWORD</tt> array prior to use the fast seek mode. To create the CLMT, set address of the <tt>DWORD</tt> array to the member <tt>cltbl</tt> in the open file object, set the size of array in unit of items to the <tt>cltbl[0]</tt> and then call <tt>f_lseek</tt> function with <tt class="arg">ofs</tt><tt> = CREATE_LINKMAP</tt>. After the function succeeded, no FAT access is occured in subsequent <tt>f_read</tt>, <tt>f_write</tt>, <tt>f_lseek</tt> function to the file. The number of items used or required is returned into the <tt>cltbl[0]</tt>. 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 <tt>FR_NOT_ENOUGH_CORE</tt>, the size of given array is insufficient for the file.</p>
|
||||
<p>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 <tt>f_read</tt> and <tt>f_write</tt> function as well, however, the file size cannot be expanded by <tt>f_write</tt>, <tt>f_lseek</tt> function while the file is in fast seek mode.</p>
|
||||
<p>The fast seek mode is available when <tt>FF_USE_FASTSEEK = 1</tt>. The CLMT must be created into a <tt>DWORD</tt> array prior to use the fast seek mode. To create the CLMT, set address of the <tt>DWORD</tt> array to the member <tt>cltbl</tt> in the open file object, set the size of array in unit of items to the <tt>cltbl[0]</tt> and then call <tt>f_lseek</tt> function with <tt class="arg">ofs</tt><tt> = CREATE_LINKMAP</tt>. The number of items used or required is returned into the <tt>cltbl[0]</tt>. 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 <tt>FR_NOT_ENOUGH_CORE</tt>, the size of given array is insufficient for the file. After the function succeeded, no FAT access is occured in subsequent <tt>f_read</tt>, <tt>f_write</tt>, <tt>f_lseek</tt> function to the file. To disable the fast seek mode, set null pointer to the <tt>cltbl</tt>.</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
@@ -35,11 +35,11 @@ FRESULT f_mkfs (
|
||||
<dt>BYTE n_fat</dt>
|
||||
<dd>Specifies number of FAT copies on the FAT/FAT32 volume. Valid value for this member is 1 or 2. The default value (0) and any invaid value gives 1. If the FAT type is exFAT, this member has no effect.</dd>
|
||||
<dt>UINT align</dt>
|
||||
<dd>Specifies alignment of the volume data area (file allocation pool, usually erase block boundary of flash memory media) <em>in unit of sector</em>. The valid value for this member is between 1 and 32768 inclusive in power of 2. If a zero (the default value) or any invalid value is given, the function obtains the block size from lower layer with <tt>disk_ioctl</tt> function.</dd>
|
||||
<dd>Specifies alignment of the volume data area (file allocation pool, usually erase block boundary of flash memory media) <em>in unit of sector</em>. The valid value for this member is between 1 and 32768 inclusive in power of 2. If a zero (the default value) or an invalid value is given, the function obtains the block size from lower layer with <tt>disk_ioctl</tt> function.</dd>
|
||||
<dt>UINT n_root</dt>
|
||||
<dd>Specifies number of root directory entries on the FAT volume. Valid value for this member is up to 32768 and aligned to sector size / 32. The default value (0) and any invaid value gives 512. If the FAT type is FAT32 or exFAT, this member has no effect.</dd>
|
||||
<dt>DWORD au_size</dt>
|
||||
<dd>Specifies size of the cluster (allocation unit) <em>in unit of byte</em>. The valid value for this member is between sector size and 128 * sector size inclusive in power of 2 for FAT/FAT32 volume and up to 16 MB in power of 2 for exFAT volume. If a zero (default value) or any invalid value is given, the function uses a default cluster size depends on the volume size.</dd>
|
||||
<dd>Specifies size of the cluster (allocation unit) <em>in unit of byte</em>. The valid value for this member is between sector size and 128 * sector size inclusive in power of 2 for FAT/FAT32 volume and up to 16 MB in power of 2 for exFAT volume. If a zero (default value) or an invalid value is given, the function uses a default cluster size depends on the volume size.</dd>
|
||||
</dl>
|
||||
<dt>work</dt>
|
||||
<dd>Pointer to the working buffer used for the format process. If a null pointer is given with <tt><a href="config.html#use_lfn">FF_USE_LFN</a> == 3</tt>, the function uses a <tt>len</tt> bytes of heap memory in this function.</dd>
|
||||
@@ -68,8 +68,8 @@ FRESULT f_mkfs (
|
||||
<p>The allocation unit, also known as <em>cluster</em>, 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.</p>
|
||||
<p>When the logical drive to be formatted is associated with a physical drive (<tt><a href="config.html#multi_partition">FF_MULTI_PARTITION</a> == 0</tt> or <tt>VolToPart[].pt == 0</tt>) and <tt>FM_SFD</tt> flag is not specified, a partition occupies entire drive space is created and then the FAT volume is created in the partition. When <tt>FM_SFD</tt> flag is specified, the FAT volume is created without any disk partitioning.</p>
|
||||
<p>When the logical drive to be formatted is associated with a specific partition by multiple partition feature (<tt>FF_MULTI_PARTITION == 1</tt> and <tt>VolToPart[].pt > 0</tt>), the FAT volume is created in the partition of the physical drive specified by <a href="filename.html#vol">volume mapping table</a> and <tt>FM_SFD</tt> flag is ignored. The hosting physical drive needs to be partitioned with <tt>f_fdisk</tt> function or some partitioning tool prior to create the FAT volume with this function. If the partition is not exist, the function fails with <tt>FR_MKFS_ABORTED</tt>.</p>
|
||||
<p>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.</p>
|
||||
<p>Some systems manage the partitions in the on-board storage in non-standard format. The partitions are mapped as physical drives identified by <tt class="arg">pdrv</tt> in <tt>disk_*</tt> functions. For such systems, SFD format is suitable to create the FAT volume in the partition.</p>
|
||||
<p>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 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.</p>
|
||||
<p>Some systems manage the partitions of on-board storage in non-standard format. The partitions are mapped as physical drives identified by <tt class="arg">pdrv</tt> in <tt>disk_*</tt> functions. For such systems, SFD format is suitable to create the FAT volume in the partition.</p>
|
||||
</div>
|
||||
|
||||
<div class="para comp">
|
||||
|
||||
+11
-11
@@ -86,16 +86,16 @@ FRESULT list_dir (const char *path)
|
||||
int nfile, ndir;
|
||||
|
||||
|
||||
res = <em>f_opendir</em>(&dir, path); <span class="c">/* Open the directory */</span>
|
||||
res = <em>f_opendir</em>(&dir, path); <span class="c">/* Open the directory */</span>
|
||||
if (res == FR_OK) {
|
||||
nfile = ndir = 0;
|
||||
for (;;) {
|
||||
res = <em>f_readdir</em>(&dir, &fno); <span class="c">/* Read a directory item */</span>
|
||||
if (res != FR_OK || fno.fname[0] == 0) break; <span class="c">/* Error or end of dir */</span>
|
||||
if (fno.fattrib & AM_DIR) { <span class="c">/* Directory */</span>
|
||||
res = <em>f_readdir</em>(&dir, &fno); <span class="c">/* Read a directory item */</span>
|
||||
if (fno.fname[0] == 0) break; <span class="c">/* Error or end of dir */</span>
|
||||
if (fno.fattrib & AM_DIR) { <span class="c">/* It is a directory */</span>
|
||||
printf(" <DIR> %s\n", fno.fname);
|
||||
ndir++;
|
||||
} else { <span class="c">/* File */</span>
|
||||
} else { <span class="c">/* It is a file */</span>
|
||||
printf("%10u %s\n", fno.fsize, fno.fname);
|
||||
nfile++;
|
||||
}
|
||||
@@ -121,18 +121,18 @@ FRESULT scan_files (
|
||||
static FILINFO fno;
|
||||
|
||||
|
||||
res = <em>f_opendir</em>(&dir, path); <span class="c">/* Open the directory */</span>
|
||||
res = <em>f_opendir</em>(&dir, path); <span class="c">/* Open the directory */</span>
|
||||
if (res == FR_OK) {
|
||||
for (;;) {
|
||||
res = <em>f_readdir</em>(&dir, &fno); <span class="c">/* Read a directory item */</span>
|
||||
if (res != FR_OK || fno.fname[0] == 0) break; <span class="c">/* Break on error or end of dir */</span>
|
||||
if (fno.fattrib & AM_DIR) { <span class="c">/* It is a directory */</span>
|
||||
res = <em>f_readdir</em>(&dir, &fno); <span class="c">/* Read a directory item */</span>
|
||||
if (fno.fname[0] == 0) break; <span class="c">/* Break on error or end of dir */</span>
|
||||
if (fno.fattrib & AM_DIR) { <span class="c">/* The item is a directory */</span>
|
||||
i = strlen(path);
|
||||
sprintf(&path[i], "/%s", fno.fname);
|
||||
res = scan_files(path); <span class="c">/* Enter the directory */</span>
|
||||
res = scan_files(path); <span class="c">/* Enter the directory */</span>
|
||||
if (res != FR_OK) break;
|
||||
path[i] = 0;
|
||||
} else { <span class="c">/* It is a file. */</span>
|
||||
} else { <span class="c">/* The item is a file. */</span>
|
||||
printf("%s/%s\n", path, fno.fname);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ FRESULT f_setlabel (
|
||||
<li>Allowable characters for exFAT volume are: characters allowed for LFN includes dot. Low-case characters are preserved.</li>
|
||||
<li>Spaces can be embedded anywhere in the volume label. Trailing spaces are truncated off at FAT volume.</li>
|
||||
</ul>
|
||||
<p>Remark: The standard system (Windows) has a problem at the volume label with a heading <tt>\xE5</tt> on the FAT volume. To avoid this problem, this function rejects such volume label as invalid name.</p>
|
||||
<p>Remark: The standard system (Windows) has a problem in the volume label with a heading <tt>\xE5</tt> on the FAT volume. To avoid this problem, this function rejects such volume label as invalid name.</p>
|
||||
</div>
|
||||
|
||||
<div class="para comp">
|
||||
|
||||
@@ -17,6 +17,10 @@
|
||||
FSIZE_t fsize; <span class="c">/* File size */</span>
|
||||
WORD fdate; <span class="c">/* Last modified date */</span>
|
||||
WORD ftime; <span class="c">/* Last modified time */</span>
|
||||
<span class="k">#if</span> FF_FS_CRTIME
|
||||
WORD crdate; <span class="c">/* Created date */</span>
|
||||
WORD crtime; <span class="c">/* Created time */</span>
|
||||
<span class="k">#endif</span>
|
||||
BYTE fattrib; <span class="c">/* Attribute */</span>
|
||||
<span class="k">#if</span> FF_USE_LFN
|
||||
TCHAR altname[FF_SFN_BUF + 1]; <span class="c">/* Alternative object name */</span>
|
||||
@@ -54,6 +58,12 @@
|
||||
<dd>Second / 2 (0..29)</dd>
|
||||
</dl>
|
||||
</dd>
|
||||
<dt>crdate</dt>
|
||||
<dd>The date when the file/directory was created. This member is available when <tt><a href="config.html#fs_ctime">FF_FS_CRTIME</a> = 1</tt>.
|
||||
</dd>
|
||||
<dt>crtime</dt>
|
||||
<dd>The time when the file/directory was created. This member is available when <tt>FF_FS_CRTIME = 1</tt>
|
||||
</dd>
|
||||
<dt>fattrib</dt>
|
||||
<dd>The attribute flags in combination of:<br>
|
||||
<table class="lst">
|
||||
@@ -66,7 +76,7 @@
|
||||
</table>
|
||||
</dd>
|
||||
<dt>fname[]</dt>
|
||||
<dd>Null-terminated object name. A null string is stored when no item to read and it indicates this structure is invalid. The size of <tt>fname[]</tt> and <tt>altname[]</tt> each can be configured in LFN configuration.</dd>
|
||||
<dd>Null-terminated object name is stored. If no item to read or an error occured in the function, a null string is stored to indicate this structure is invalid. The size of <tt>fname[]</tt> and <tt>altname[]</tt> each can be configured in LFN configuration.</dd>
|
||||
<dt>altname[]</dt>
|
||||
<dd>Alternative object name is stored if available. This member is not available in non-LFN configuration.</dd>
|
||||
</dl>
|
||||
|
||||
@@ -102,7 +102,7 @@ FRESULT f_stat (
|
||||
|
||||
|
||||
<div class="para ref">
|
||||
<h4>References</h4>
|
||||
<h4>See Also</h4>
|
||||
<p><tt><a href="opendir.html">f_opendir</a>, <a href="readdir.html">f_readdir</a>, <a href="sfileinfo.html">FILINFO</a></tt></p>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<pre>
|
||||
FRESULT f_utime (
|
||||
const TCHAR* <span class="arg">path</span>, <span class="c">/* [IN] Object name */</span>
|
||||
const FILINFO* <span class="arg">fno</span> <span class="c">/* [IN] Time and data to be set */</span>
|
||||
const FILINFO* <span class="arg">fno</span> <span class="c">/* [IN] Time and date to be set */</span>
|
||||
);
|
||||
</pre>
|
||||
</div>
|
||||
@@ -26,7 +26,7 @@ FRESULT f_utime (
|
||||
<dt>path</dt>
|
||||
<dd>Pointer to the null-terminated string that specifies an <a href="filename.html">object</a> to be changed. If a null pointer is given, the function fails with <tt>FR_INVALID_DRIVE</tt>.</dd>
|
||||
<dt>fno</dt>
|
||||
<dd>Pointer to the file information structure that has a timestamp to be set in member fdate and ftime. Do not care any other members.</dd>
|
||||
<dd>Pointer to the file information structure that has new timestamps to be set in the members. <tt>fdate</tt> and <tt>ftime</tt> are for the last modified time. When <tt><a href="config.html#fs_ctime">FF_FS_CRTIME</a> = 1</tt>, <tt>crdate</tt> and <tt>crtime</tt> for the created time are available in addition. Every timestamp is in local time. If <tt>fdate</tt> or <tt>crdate</tt> is invalid (0), the modified time or created time is left unchanged respectively. Do not care any other member.</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
@@ -61,7 +61,7 @@ FRESULT f_utime (
|
||||
<h4>Example</h4>
|
||||
<pre>
|
||||
FRESULT set_timestamp (
|
||||
char *obj, <span class="c">/* Pointer to the file name */</span>
|
||||
const char *fname, <span class="c">/* Pointer to the file name */</span>
|
||||
int year,
|
||||
int month,
|
||||
int mday,
|
||||
@@ -74,8 +74,10 @@ FRESULT set_timestamp (
|
||||
|
||||
fno.fdate = (WORD)(((year - 1980) * 512U) | month * 32U | mday);
|
||||
fno.ftime = (WORD)(hour * 2048U | min * 32U | sec / 2U);
|
||||
|
||||
return <em>f_utime</em>(obj, &fno);
|
||||
<span class="k">#if</span> FF_FS_CRTIME
|
||||
fno.crdate = 0; <span class="c">/* Do not change created time in this code */</span>
|
||||
<span class="k">#endif</span>
|
||||
return <em>f_utime</em>(fname, &fno);
|
||||
}
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user