fatfs v0.08b Jan 15,2011:
- Fast seek feature is also applied to f_read() and f_write(). - f_lseek() reports required table size on creating CLMP. - Extended format syntax of f_printf function. - Ignores duplicated directory separators in given path names.
This commit is contained in:
1 parent
625f3adcbb
commit
5fa1073a5a
98 files changed
+2819
-2235
No files matched your search
@@ -10,12 +10,13 @@
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h1>Path Names</h1>
|
||||
|
||||
<div class="para">
|
||||
<h3>Format of the path names</h3>
|
||||
<p>The path name format on the FatFs module is similer to the filename specs of DOS/Windos as follows:</p>
|
||||
<p><tt>"[drive#:][/]directory/file"</tt></p>
|
||||
<p>The FatFs module supports long file name (LFN) and 8.3 format file name (SFN). The LFN can be used when LFN feature is enabled <tt>(_USE_LFN > 0)</tt>. The sub directories are separated with a \ or / in the same way as DOS/Windows API. Only a difference is that the logical drive is specified in a numeral with a colon. When the drive number is omitted, it is assumed as default drive (0 or current drive).</p>
|
||||
<p>The FatFs module supports long file name (LFN) and 8.3 format file name (SFN). The LFN can be used when LFN feature is enabled <tt>(_USE_LFN > 0)</tt>. The sub directories are separated with a \ or / in the same way as DOS/Windows API. Duplicated separators are skipped and ignored. Only a difference is that the logical drive is specified in a numeral with a colon. When the drive number is omitted, it is assumed as default drive (0 or current drive).</p>
|
||||
<p>Control characters (\0 to \x1F) are recognized as end of the path name. Leading/embedded spaces in the path name are valid as a part of the name on LFN configuration but they are recognized as end of the path name on non-LFN configuration. Trailing spaces and dots are ignored.</p>
|
||||
<p>In default configuration <tt>(_FS_RPATH == 0)</tt>, it does not have a concept of current directory like OS oriented file system. All objects on the volume are always specified in full path name that follows from the root directory. Dot directory names are not allowed. Heading separator is ignored and it can be exist or omitted. The default drive number is fixed to 0.</p>
|
||||
<p>When relative path feature is enabled <tt>(_FS_RPATH == 1)</tt>, specified path is followed from the root directory if a heading separator is exist. If not, it is followed from the current directory set with <a href="chdir.html">f_chdir</a> function. Dot names are also allowed for the path name. The default drive is the current drive set with <a href="chdrive.html">f_chdrive</a> function.</p>
|
||||
@@ -41,9 +42,9 @@
|
||||
<h3>Unicode API</h3>
|
||||
<p>The path names are input/output in either ANSI/OEM code (SBCS/DBCS) or Unicode depends on the configuration options. The type of arguments that specifies the file names are defined as <tt>TCHAR</tt> which is an alias of <tt>char</tt> in default. The code set of the file name string is the ANSI/OEM code set specifid by <tt>_CODE_PAGE</tt>. When <tt>_LFN_UNICODE</tt> is set to 1 under LFN configuration, the type of the <tt>TCHAR</tt> is switched to <tt>unsigned short</tt> (UCS-2 character) to support Unicode. In this case, the LFN feature is fully supported and the Unicode specific characters, such as ✝☪✡☸☭, 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, <tt>_T(s)</tt> and <tt>_TEXT(s)</tt> macro are available to select either ANSI/OEM or Unicode automatically. The code shown below is an example to define the literal strings.</p>
|
||||
<pre>
|
||||
f_open(fp, "filename.txt", FA_READ); <span>/* ANSI/OEM only */</span>
|
||||
f_open(fp, L"filename.txt", FA_READ); <span>/* Unicode only */</span>
|
||||
f_open(fp, _T("filename.txt"), FA_READ); <span>/* Changed automatically */</span>
|
||||
f_open(fp, "filename.txt", FA_READ); <span class="c">/* ANSI/OEM only */</span>
|
||||
f_open(fp, L"filename.txt", FA_READ); <span class="c">/* Unicode only */</span>
|
||||
f_open(fp, _T("filename.txt"), FA_READ); <span class="c">/* Changed automatically */</span>
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
@@ -56,10 +57,10 @@ Example: Logical drive 0-2 are assigned to three pri-partitions on the physical
|
||||
Logical drive 3 is assigned to physical drive 1 (removable disk)
|
||||
|
||||
const PARTITION Drives[] = {
|
||||
{0, 0}, <span>/* Logical drive 0 ==> Physical drive 0, 1st partition */</span>
|
||||
{0, 1}, <span>/* Logical drive 1 ==> Physical drive 0, 2nd partition */</span>
|
||||
{0, 2}, <span>/* Logical drive 2 ==> Physical drive 0, 3rd partition */</span>
|
||||
{1, 0} <span>/* Logical drive 3 ==> Physical drive 1 */</span>
|
||||
{0, 0}, <span class="c">/* Logical drive 0 ==> Physical drive 0, 1st partition */</span>
|
||||
{0, 1}, <span class="c">/* Logical drive 1 ==> Physical drive 0, 2nd partition */</span>
|
||||
{0, 2}, <span class="c">/* Logical drive 2 ==> Physical drive 0, 3rd partition */</span>
|
||||
{1, 0} <span class="c">/* Logical drive 3 ==> Physical drive 1 */</span>
|
||||
};
|
||||
</pre>
|
||||
<p>There are some considerations when use <tt>_MULTI_PARTITION</tt> configuration.</p>
|
||||
|
||||
Reference in new issue
Block a user