Code Block | ||
---|---|---|
| ||
int fs_remove (const char *name_full); |
File | Called from | Code enabled by |
---|---|---|
| Application |
|
...
-1, if the file is not removed.
Notes/Warnings
- When a file is removed, the space occupied by the file is freed and shall no longer be accessible.
- A directory can be removed only if it is an empty directory.
- The root directory cannot be removed.
Example
Code Block | ||
---|---|---|
| ||
void App_Fnct (void)
{
int err;
.
.
.
err = fs_remove("sd:0:\\data\\file001.txt"); /* Remove file. */
if (err != 0) {
APP_TRACE_INFO(("Could not remove file."));
}
.
.
.
err = fs_remove("sd:0:\\data\\old"); /* Remove dir. */
if (err != 0) {
APP_TRACE_INFO(("Could not remove dir."));
}
.
.
.
} |