xref: /third_party/FatFs/documents/doc/rc.html (revision e6865dcd)
1e6865dcdSopenharmony_ci<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
2e6865dcdSopenharmony_ci<html lang="en">
3e6865dcdSopenharmony_ci<head>
4e6865dcdSopenharmony_ci<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
5e6865dcdSopenharmony_ci<meta http-equiv="Content-Style-Type" content="text/css">
6e6865dcdSopenharmony_ci<link rel="up" title="FatFs" href="../00index_e.html">
7e6865dcdSopenharmony_ci<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/rc.html">
8e6865dcdSopenharmony_ci<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
9e6865dcdSopenharmony_ci<title>FatFs - API Return Code</title>
10e6865dcdSopenharmony_ci</head>
11e6865dcdSopenharmony_ci
12e6865dcdSopenharmony_ci<body>
13e6865dcdSopenharmony_ci<h1>Return Code of API Functions</h1>
14e6865dcdSopenharmony_ci<p>Most of API functions return common result code in enum type <tt>FRESULT</tt>. When an API function succeeded, it returns zero (<tt>FR_OK</tt>), otherwise it returns non-zero value indicates type of error.</p>
15e6865dcdSopenharmony_ci
16e6865dcdSopenharmony_ci<dl class="ret">
17e6865dcdSopenharmony_ci
18e6865dcdSopenharmony_ci<dt id="ok">FR_OK (0)</dt>
19e6865dcdSopenharmony_ci<dd>The function succeeded.</dd>
20e6865dcdSopenharmony_ci
21e6865dcdSopenharmony_ci<dt id="de">FR_DISK_ERR</dt>
22e6865dcdSopenharmony_ci<dd>The lower layer, <tt>disk_read</tt>, <tt>disk_write</tt> or <tt>disk_ioctl</tt> function, reported that an unrecoverable hard error occured.<br>Note that if once this error occured at any operation to an open file, the file object is aborted and any operations to the file except for close will be rejected.</dd>
23e6865dcdSopenharmony_ci
24e6865dcdSopenharmony_ci<dt id="ie">FR_INT_ERR</dt>
25e6865dcdSopenharmony_ci<dd>Assertion failed and an insanity is detected in the internal process. One of the following possibilities is suspected.
26e6865dcdSopenharmony_ci<ul>
27e6865dcdSopenharmony_ci<li>Work area (file system object, file object or etc...) has been broken by stack overflow or something. This is the reason in most case.</li>
28e6865dcdSopenharmony_ci<li>There is an error of the FAT structure on the volume.</li>
29e6865dcdSopenharmony_ci<li>There is a bug in the FatFs module itself.</li>
30e6865dcdSopenharmony_ci<li>Wrong lower layer implementation.</li>
31e6865dcdSopenharmony_ci</ul>
32e6865dcdSopenharmony_ciNote that if once this error occured in the operation to an open file, the file object is aborted and any operation to the file except for close will be rejected.
33e6865dcdSopenharmony_ci</dd>
34e6865dcdSopenharmony_ci
35e6865dcdSopenharmony_ci<dt id="nr">FR_NOT_READY</dt>
36e6865dcdSopenharmony_ci<dd>The lower layer, <a href="dinit.html"><tt>disk_initialize</tt></a> function, reported that the storage device could not be got ready to work. One of the following possibilities is suspected.
37e6865dcdSopenharmony_ci<ul>
38e6865dcdSopenharmony_ci<li>No medium in the drive.</li>
39e6865dcdSopenharmony_ci<li>Wrong lower layer implementation.</li>
40e6865dcdSopenharmony_ci<li>Wrong hardware configuration.</li>
41e6865dcdSopenharmony_ci<li>The storage device has broken.</li>
42e6865dcdSopenharmony_ci</ul>
43e6865dcdSopenharmony_ci</dd>
44e6865dcdSopenharmony_ci
45e6865dcdSopenharmony_ci<dt id="nf">FR_NO_FILE</dt>
46e6865dcdSopenharmony_ci<dd>Could not find the file in the directory.</dd>
47e6865dcdSopenharmony_ci
48e6865dcdSopenharmony_ci<dt id="np">FR_NO_PATH</dt>
49e6865dcdSopenharmony_ci<dd>Could not find the path. A directory in the path name could not be found.</dd>
50e6865dcdSopenharmony_ci
51e6865dcdSopenharmony_ci<dt id="in">FR_INVALID_NAME</dt>
52e6865dcdSopenharmony_ci<dd>The given string is invalid as a <a href="filename.html">path name</a>. One of the following possibilities is suspected.
53e6865dcdSopenharmony_ci<ul>
54e6865dcdSopenharmony_ci<li>There is a character not allowed for the file name.</li>
55e6865dcdSopenharmony_ci<li>The file name is out of 8.3 format. (at non-LFN cfg.)</li>
56e6865dcdSopenharmony_ci<li><tt>FF_MAX_LFN</tt> is insufficient for the file name. (at LFN cfg.)</li>
57e6865dcdSopenharmony_ci<li>There is a character encoding error in the string.</li>
58e6865dcdSopenharmony_ci</ul>
59e6865dcdSopenharmony_ci</dd>
60e6865dcdSopenharmony_ci
61e6865dcdSopenharmony_ci<dt id="dn">FR_DENIED</dt>
62e6865dcdSopenharmony_ci<dd>The required access was denied due to one of the following reasons:
63e6865dcdSopenharmony_ci<ul>
64e6865dcdSopenharmony_ci<li>Write mode open against the read-only file. (f_open)</li>
65e6865dcdSopenharmony_ci<li>Deleting the read-only file or directory. (f_unlink)</li>
66e6865dcdSopenharmony_ci<li>Deleting the non-empty directory or current directory. (f_unlink)</li>
67e6865dcdSopenharmony_ci<li>Reading the file opened without <tt>FA_READ</tt> flag. (f_read)</li>
68e6865dcdSopenharmony_ci<li>Any modification to the file opened without <tt>FA_WRITE</tt> flag. (f_write, f_truncate, f_expand)</li>
69e6865dcdSopenharmony_ci<li>Could not create the object due to root directory full or disk full. (f_open, f_mkdir)</li>
70e6865dcdSopenharmony_ci<li>Could not find a contiguous area for the file. (f_expand)</li>
71e6865dcdSopenharmony_ci</ul>
72e6865dcdSopenharmony_ci</dd>
73e6865dcdSopenharmony_ci
74e6865dcdSopenharmony_ci<dt id="ex">FR_EXIST</dt>
75e6865dcdSopenharmony_ci<dd>Name collision. An object with the same name is already existing in the directory.</dd>
76e6865dcdSopenharmony_ci
77e6865dcdSopenharmony_ci<dt id="io">FR_INVALID_OBJECT</dt>
78e6865dcdSopenharmony_ci<dd>The file/directory object is invalid or a null pointer is given. There are some reasons as follows:
79e6865dcdSopenharmony_ci<ul>
80e6865dcdSopenharmony_ci<li>It has been closed, or the structure has been collapsed.</li>
81e6865dcdSopenharmony_ci<li>It has been invalidated. Open objects on the volume are invalidated by voulme mount process.</li>
82e6865dcdSopenharmony_ci<li>Physical drive is not ready to work due to a media removal.</li>
83e6865dcdSopenharmony_ci</ul>
84e6865dcdSopenharmony_ci</dd>
85e6865dcdSopenharmony_ci
86e6865dcdSopenharmony_ci<dt id="wp">FR_WRITE_PROTECTED</dt>
87e6865dcdSopenharmony_ci<dd>A write mode operation against the write-protected media.</dd>
88e6865dcdSopenharmony_ci
89e6865dcdSopenharmony_ci<dt id="id">FR_INVALID_DRIVE</dt>
90e6865dcdSopenharmony_ci<dd>Invalid drive number is specified in the path name or a null pointer is given as the path name. (Related option: <tt><a href="config.html#volumes">FF_VOLUMES</a></tt>)</dd>
91e6865dcdSopenharmony_ci
92e6865dcdSopenharmony_ci<dt id="ne">FR_NOT_ENABLED</dt>
93e6865dcdSopenharmony_ci<dd>Work area for the logical drive has not been registered by <tt>f_mount</tt> function.</dd>
94e6865dcdSopenharmony_ci
95e6865dcdSopenharmony_ci<dt id="ns">FR_NO_FILESYSTEM</dt>
96e6865dcdSopenharmony_ci<dd>Valid FAT volume could not be found in the drive. One of the following possibilities is suspected.
97e6865dcdSopenharmony_ci<ul>
98e6865dcdSopenharmony_ci<li>The FAT volume on the drive is collapsed.</li>
99e6865dcdSopenharmony_ci<li>Wrong lower layer implementation.</li>
100e6865dcdSopenharmony_ci<li>Wrong <tt>VolToPart[]</tt> settings. (<tt>FF_MULTI_PARTITION = 1</tt>)</li>
101e6865dcdSopenharmony_ci</ul></dd>
102e6865dcdSopenharmony_ci
103e6865dcdSopenharmony_ci<dt id="ma">FR_MKFS_ABORTED</dt>
104e6865dcdSopenharmony_ci<dd>The <tt>f_mkfs</tt> function aborted before start in format due to a reason as follows:
105e6865dcdSopenharmony_ci<ul>
106e6865dcdSopenharmony_ci<li>It is impossible to create the volume with the given conditions.</li>
107e6865dcdSopenharmony_ci<li>The size of the volume is too small. 128 sectors minimum with <tt>FM_SFD</tt> option.</li>
108e6865dcdSopenharmony_ci<li>The partition associated with the logical drive is not exist. (Related option: <tt><a href="config.html#multi_partition">FF_MULTI_PARTITION</a></tt>)</li>
109e6865dcdSopenharmony_ci</ul>
110e6865dcdSopenharmony_ci</dd>
111e6865dcdSopenharmony_ci
112e6865dcdSopenharmony_ci<dt id="tm">FR_TIMEOUT</dt>
113e6865dcdSopenharmony_ci<dd>The function was canceled due to a timeout of <a href="appnote.html#reentrant">thread-safe control</a>. (Related option: <tt><a href="config.html#timeout">FF_TIMEOUT</a></tt>)</dd>
114e6865dcdSopenharmony_ci
115e6865dcdSopenharmony_ci<dt id="lo">FR_LOCKED</dt>
116e6865dcdSopenharmony_ci<dd>The operation to the object was rejected by <a href="appnote.html#dup">file sharing control</a>. (Related option: <tt><a href="config.html#fs_lock">FF_FS_LOCK</a></tt>)</dd>
117e6865dcdSopenharmony_ci
118e6865dcdSopenharmony_ci<dt id="nc">FR_NOT_ENOUGH_CORE</dt>
119e6865dcdSopenharmony_ci<dd>Not enough memory for the operation. There is one of the following reasons:
120e6865dcdSopenharmony_ci<ul>
121e6865dcdSopenharmony_ci<li>Could not allocate a memory for LFN working buffer. (Related option: <tt><a href="config.html#use_lfn">FF_USE_LFN</a></tt>)</li>
122e6865dcdSopenharmony_ci<li>Size of the given buffer is insufficient for the size required.</li>
123e6865dcdSopenharmony_ci</ul>
124e6865dcdSopenharmony_ci</dd>
125e6865dcdSopenharmony_ci
126e6865dcdSopenharmony_ci<dt id="tf">FR_TOO_MANY_OPEN_FILES</dt>
127e6865dcdSopenharmony_ci<dd>Number of open objects has been reached maximum value and no more object can be opened. (Related option: <tt><a href="config.html#fs_lock">FF_FS_LOCK</a></tt>)</dd>
128e6865dcdSopenharmony_ci
129e6865dcdSopenharmony_ci<dt id="ip">FR_INVALID_PARAMETER</dt>
130e6865dcdSopenharmony_ci<dd>The given parameter is invalid or there is an inconsistent for the volume.</dd>
131e6865dcdSopenharmony_ci</dl>
132e6865dcdSopenharmony_ci
133e6865dcdSopenharmony_ci<p class="foot"><a href="../00index_e.html">Return</a></p>
134e6865dcdSopenharmony_ci</body>
135e6865dcdSopenharmony_ci</html>
136