<p>The f_unlink function removes a file or sub-directory.</p>
<pre>
FRESULT f_unlink (
const TCHAR* <spanclass="arg">path</span><spanclass="c">/* [IN] Object name */</span>
);
</pre>
</div>
<divclass="para arg">
<h4>Parameter</h4>
<dlclass="par">
<dt>path</dt>
<dd>Pointer to the null-terminated string that specifies an <ahref="filename.html">object</a> to be removed.</dd>
</dl>
</div>
<divclass="para ret">
<h4>Return Values</h4>
<p>
<ahref="rc.html#ok">FR_OK</a>,
<ahref="rc.html#de">FR_DISK_ERR</a>,
<ahref="rc.html#ie">FR_INT_ERR</a>,
<ahref="rc.html#nr">FR_NOT_READY</a>,
<ahref="rc.html#ok">FR_NO_FILE</a>,
<ahref="rc.html#np">FR_NO_PATH</a>,
<ahref="rc.html#in">FR_INVALID_NAME</a>,
<ahref="rc.html#de">FR_DENIED</a>,
<ahref="rc.html#ex">FR_EXIST</a>,
<ahref="rc.html#wp">FR_WRITE_PROTECTED</a>,
<ahref="rc.html#id">FR_INVALID_DRIVE</a>,
<ahref="rc.html#ne">FR_NOT_ENABLED</a>,
<ahref="rc.html#ns">FR_NO_FILESYSTEM</a>,
<ahref="rc.html#tm">FR_TIMEOUT</a>,
<ahref="rc.html#lo">FR_LOCKED</a>,
<ahref="rc.html#nc">FR_NOT_ENOUGH_CORE</a>
</p>
</div>
<divclass="para desc">
<h4>Description</h4>
<p>
If condition of the object to be removed is applicable to the following terms, the function will be rejected.<ul>
<li>The file/sub-directory must not have read-only attribute (<tt>AM_RDO</tt>), or the function will be rejected with <tt>FR_DENIED</tt>.</li>
<li>The sub-directory must be empty and must not be current directory, or the function will be rejected with <tt>FR_DENIED</tt>.</li>
<li>The file/sub-directory must not be opened, or the <em>FAT volume can be collapsed</em>. It can be rejected with <tt>FR_LOCKED</tt> when <ahref="appnote.html#dup">file lock feature</a> is enabled.</li>
</ul>
</div>
<divclass="para comp">
<h4>QuickInfo</h4>
<p>Available when <tt>_FS_READONLY == 0</tt> and <tt>_FS_MINIMIZE == 0</tt>.</p>